concept section in category entity framework

This is an excerpt from Manning's book Entity Framework Core in Action, SE.
Listing 1.1 shows the other class you’ll be using: Author. This has the same structure as the Book class in figure 1.4, with a primary key that follows the EF Core naming conventions of <ClassName>Id (see section 8.?). The Book class has a property called AuthorId, which EF Core knows is a foreign key because it has the same name as the
Authorprimary key.
In this example I have a primary key and a foreign key, as it makes the relationship easier to understand. But for one-to-one relationships, you can make the foreign key be the primary key too. For instance, in the PriceOffer table shown in figure 2.1, you would have primary key called BookId, which would also be the foreign key. That means you lose the PriceOfferId column, which makes the table slightly more efficient from the database side. I cover this later in section 8.?

This is an excerpt from Manning's book Entity Framework Core in Action.
The basic idea is that an EF Core’s
LazyLoaderinstance will be provided via an entity class constructor with a parameter (see section B.2.2). As you can see in listing B.1, the navigational property you want to lazy load must be set up as a backing field (see section 8.1). The property’s getter accesses the backing field via a call to theLazyLoaderservice, which ensures that the navigation property is loaded on a read.
Figure 7.1 The
BookandReviewentity classes show six of the terms used in this chapter to discuss relationships: principal entity, dependent entity, principal key, navigational property, foreign key, and required relationship. Not shown is the optional relationship, which is described in section 2.4.4.![]()
You can find these fluent validation extension methods at http://mng.bz/6mu6, but I’ve also included them, plus a few extra fluent validations, in the NuGet package called EfCore.TestSupport that I’ve built. See section 15.1.2.
Listing 15.7 Creating
DbContextOptions<T>for in-memory SQLite databasepublic static DbContextOptions<T> CreateOptions<T> (bool throwOnClientServerWarning = true) #1 where T : DbContext { var connectionStringBuilder = #2 new SqliteConnectionStringBuilder #2 { DataSource = ":memory:" }; #2 var connectionString = #3 connectionStringBuilder.ToString(); #3 var connection = #4 new SqliteConnection(connectionString); #4 connection.Open(); #5 // create in-memory context var builder = new DbContextOptionsBuilder<T>(); builder.UseSqlite(connection); #6 builder.ApplyOtherOptionSettings #7 (throwOnClientServerWarning); #7 return builder.Options; #8 } #1 By default, it throws an exception if a QueryClientEvaluationWarning is logged (see section 15.8). You can turn this off by providing a value of false as a parameter. #2 Creates an SQLite connection string with the DataSource set to “:memory:” #3 Turns the SQLiteConnectionStringBuilder into a string #4 Forms an SQLite connection using the connection string #5 You must open the SQLite connection. If you don’t, the in-memory database doesn’t work. #6 Builds DbContextOptions<T> with the SQLite database provider and the open connection #7 Calls a general method used on all your option builders. If throwOnClientServerWarning is true, it configures the warning to throw on a QueryClientEvaluationWarning being logged. #8 Returns the DbContextOptions<T> to use in the creation of your application’s DbContext

This is an excerpt from Manning's book Entity Framework 4 in Action.
Objects are superior to datasets in every situation because they don’t suffer from the limitations that general-purpose structures do. They offer type safety, autocompletion in Visual Studio, compile-time checking, better performance, and more. We’ll talk more about objects in section 1.2.
If you attach an entity to the context (more on this in section 6.2), it will move to the Unchanged state. If you retrieve an entity from the database and then get rid of the context, the entity state will be Detached. If you retrieve an entity, dispose of the context, and create a new context and add the entity to it, the entity will be in the Added state (again, this will be explained in section 6.2). As these examples make clear, the state is the relationship between the entity and the context that holds a reference to it.
ChangeState is exposed by the ObjectStateEntry class, whereas ChangeObject-State is exposed by the ObjectStateManager class (more on these classes in section 6.3). ChangeState only needs the new state, because the ObjectStateEntry instance already refers to an entity. ChangeObjectState accepts the entity and the new state as arguments. Both methods are shown in the following listing.