In this Entity Framework Core tutorial series, you will gain proficiency in handling data within your .NET applications.
What you’ll learn in this tutorial series:
- Build your first EF Core application.
- Interact with EF core data model.
- Control database creation and schema changes via migrations.
- Logging SQL and EF Core actions.
- Work with relationships like one-to-one, one-to-many, and many-to-many.
- Work with raw SQL, views, stored procedures, and other database objects.
- Test EF core application.
Section 1. Getting Started with Entity Framework Core
This section helps you get started with EF Core by understanding what EF core is, how to start a new .NET app that uses EF Core, how to create a data model and DB connection, and how to perform a simple CRUD via EF Core’s API.
- What is Entity Framework Core – a quick introduction to the Entity Framework Core, its features and benefits, and why you should use entity framework core.
- Getting Started with Entity Framework Core – help you get started with the Entity Framework core by setting up a project and installing the required packages and tools.
- How to log SQL queries in EF Core – show you step by step how to log SQL queries in EF Core.
- Creating and Applying Migrations – guide you on how to create migrations that capture the changes of the models and apply them to the database.
Section 2. EF Core Relationships
This section teaches you to understand the representation of relationships in object models and relational database and explain to you how EF Core maps between the two.
- One-to-many relationships – show you how a single entity associates with zero or more entities.
- One-to-one relationships – learn how to associate an entity with another entity using a one-to-one relationship.
- Many-to-many relationships – guide you on how to use a many-to-many relationship to associate any number of entities of an entity type with any number of other entities of another entity type.
Section 3. Querying data using LINQ from Entity Framework Core
This section guides you on how to query data from one or more database tables using both EF Core and LINQ methods:
- EF Core Sample Project – download an EF Core Sample Project to create a database and populate data for learning the query.
- Select – show you how to select one or more columns using the LINQ Select() method.
- Order By – learn how to sort data using the LINQ OrderBy(), ThenBy(), OrderByDescending(), and ThenByDescending() methods.
- Where() – learn how to filter data using the LINQ Where() method and how to use the AND and OR operator to combine multiple conditions in the Where() method.
- IN – check if a value matches a list of values using LINQ Contains() method.
- LIKE – guide you on how to query data based on pattern matching using the LIKE operator
- Inner join – show you how to use the Include() method to form a query that uses join to get data from two or more tables.
- Group By – learn how to group rows into groups and apply an aggregate function to each group.
Section 4. Modifying Data
This section teaches you to create, read, update, and delete entities in EF Core. These operations are known as CRUD:
Section 5. Working with Stored Procedures, Views, and Raw SQL
This section shows you how to work with stored procedures and views in EF Core.
- Executing Stored Procedures in EF Core – show you how to execute a stored procedure in EF Core.
- Querying Data from a Database View – learn how to query data from a database view.
- Executing a Raw SQL using the ExecuteSQLRaw() method – show you how to execute a raw SQL using the ExecuteSQLRaw() method and return the number of rows affected.