Loading topic
Blog and Post.2 min readBlog and Post. They are plain C# classes, and they don't know anything about databases yet. The class that connects them to a database is called a DbContext.2 min readBloggingContext knows which tables exist. It still needs two more facts: what kind of database to use and where that database lives. This chapter shows you how to supply both.2 min readBloggingContext. The database file does not exist yet. Migrations are how EF Core builds it.2 min readBlogs and Posts tables. This chapter shows how to read rows from those tables using C# code instead of SQL.1 min readSaveChanges.2 min readBlog to its Post rows with navigation properties. A navigation property is a property that points to a related entity, such as Blog.Posts or Post.Blog. EF Core does not fill these properties automatically when you run a query. You have to tell it when to loa2 min readSaveChangesAsync, and the database was updated. You never had to tell EF Core which objects had changed. This chapter explains how EF Core knows.2 min readDbContext yourself with new BloggingContext(). In a web app, it is better to let ASP.NET Core create the context for you. This chapter shows how.2 min readSaveChangesAsync. That works well for a few rows. If you need to change thousands of rows, it gets slow. EF Core has to load every row into memory and track each one, then send an UPDATE or DELETE for every row2 min read