We begin with an introduction to Entity Framework Core, followed by an essential update on .NET 8, setting the stage for the detailed exploration that follows. The course systematically guides you through the Environment Setup, ensuring you have the necessary tools and understanding to proceed. Begin with basic concepts and progressively advance to more complex topics. The course covers project setup in both Visual Studio and Visual Studio Code, explaining data models, database context, and database support in EF Core. You’ll learn about code-first development, migrations, and even reverse engineering an existing database, providing a well-rounded understanding of database interactions using EF Core. Then we delve into querying a database, discussing everything from basics and filters to advanced querying techniques and performance enhancement tips. You’ll gain insights into manipulating data, handling changes, and managing database migrations effectively. Next, we will take a deep dive into database relationships, and you’ll explore various types of relationships and their practical implementation. As you’ll work with raw SQL, views, stored procedures, and the integration of EF Core with ASP.NET Core. The course concludes with a look at data validation, database transactions, and handling data concurrency issues.
Overview
COURSE DIFFICULTY
Skills Learned
After completing this online training course, students will be able to:
Understand the basics of Entity Framework Core and its role in .NET applications.
Get acquainted with the latest features and updates introduced in .NET 8, relevant to Entity Framework Core development.
Set up the development environment, including necessary tools for working with Entity Framework Core.
Knowledge of configuring projects in both Visual Studio and Visual Studio Code to use Entity Framework Core.
Proficiency in defining data models and configuring the database context, crucial for interacting with databases.
Define database schemas and managing database versions through migrations.
Ability to reverse engineer an existing database into an Entity Framework Core model.
Understand how to query databases using EF Core, from basic queries and filters to advanced querying techniques and performance optimization.
Proficiency in manipulating data, including creating, updating, and deleting records, and managing changes within the database context.
Deep understanding of implementing various types of database relationships (one-to-one, one-to-many, many-to-many) using EF Core.
Execute raw SQL queries, using views, and integrating stored procedures within EF Core applications.
Knowledge of integrating Entity Framework Core with ASP.NET Core for developing web applications.
Understand how to implement data validation and managing database transactions to ensure data integrity and consistency.
Handle data concurrency issues, ensuring reliable data access and modification in multi-user environments.
01. Introduction
- Introduction
- What is Entity Framework Core?
02. Environment Setup
- Toolset Overview
- Install Visual Studio – Windows
- Install Visual Studio Code
- Install .NET Core and EF Core Tools
03. Getting Started with Entity Framework Core
- Setup Project Solution – Visual Studio
- Setup Project Solution – Visual Studio Code + Dotnet CLI
- What are Data Models?
- Creating the Data Models with EF Core
- Understanding the Database Context
- Adding a Database Context
- EF Core and Database Support
- Specifying the Data Provider and Connection String
- Understanding Code First Development and Migrations
- Setup Console App Project
- Adding a Migration
- Generating a Database (Code-First)
- Understanding Database First Development
- Reverse Engineer Existing Database
- Seeding Data
04. Using Entity Framework Core to Query a Database
- Adding Verbose Logging to EF Core’s Workload
- LINQ as Entity Framework Core Syntax
- Querying Basics
- Synchronous vs. Asynchronous Syntax
- Querying for a Single Record
- Add Filters to Queries
- Additional Filtering Features
- Alternative LINQ Syntax
- Aggregate Methods
- Group By
- Order By
- Skip and Take
- Projections and Custom Data Types
- Tracking Vs. No Tracking
- IQueryables vs List Types
- Efficient Querying Tips and Tricks
05. Using Entity Framework Core to Manipulate Data
- Understanding Tracking and Saving Changes
- Simple Insert Operations
- Simple Update Operations
- Simple Delete Operations
- ExecuteUpdate and ExecuteDelete
06. Handling Database Changes and Migrations
- Review Entity Framework Core Migrations
- Adding More Entities
- Updating Database with Migration(s)
- Using Configuration Files
- Generating Migration Scripts
- Rolling Back Migrations and Database Changes
- EF Bundles
- Applying Migrations at Runtime
07. Interacting With Related Records
- Database Relationships and Entity Framework Core
- One to Many Relationships
- Many to Many Relationships
- Understanding One-To-One Relationships
- Update Database With Relationships
- Inserting Related Data
- Understanding Loading Methods
- Including Related Data with Eager Loading
- Including Related Data with Explicit Loading
- Including Related Data with Lazy Loading
- Filtering on Related Records
- Projections and Anonymous Data Types
- Understanding Delete Behaviors
08. Working With Raw SQL, Views and Stored Procedures
- Adding Non-Table Objects with Migrations
- Querying Keyless Entities (Like Views)
- Querying with Raw SQL
- Querying scalar
- Executing User-defined Functions
- Limitations of Raw Queries and EF Core
09. ASP.NET Core and EF Core
- How EF Core and ASP.NET Core Work
- Create ASP.NET Core Project
- Connect to the Database Context
- Fixing EF Core Design Time Errors
- Scaffolding Code with Visual Studio
- Scaffolding Code with Visual Studio Code
- Exploring Scaffolded Code
- Review Best Practices
10. Additional Features and Considerations
- Manipulate Entries Before Saving Changes
- SQL Server Temporal Tables
- Data Validation with Data Annotations
- Pre-convention model configuration
- Support For Database Transactions
- Handling Data Concurrency Issues
- Using Query Filters
- Database Connection Retry and Timeout Policies
SKILLS LEARNED
Skills Learned
After completing this online training course, students will be able to:
Understand the basics of Entity Framework Core and its role in .NET applications.
Get acquainted with the latest features and updates introduced in .NET 8, relevant to Entity Framework Core development.
Set up the development environment, including necessary tools for working with Entity Framework Core.
Knowledge of configuring projects in both Visual Studio and Visual Studio Code to use Entity Framework Core.
Proficiency in defining data models and configuring the database context, crucial for interacting with databases.
Define database schemas and managing database versions through migrations.
Ability to reverse engineer an existing database into an Entity Framework Core model.
Understand how to query databases using EF Core, from basic queries and filters to advanced querying techniques and performance optimization.
Proficiency in manipulating data, including creating, updating, and deleting records, and managing changes within the database context.
Deep understanding of implementing various types of database relationships (one-to-one, one-to-many, many-to-many) using EF Core.
Execute raw SQL queries, using views, and integrating stored procedures within EF Core applications.
Knowledge of integrating Entity Framework Core with ASP.NET Core for developing web applications.
Understand how to implement data validation and managing database transactions to ensure data integrity and consistency.
Handle data concurrency issues, ensuring reliable data access and modification in multi-user environments.
COURSE OUTLINE
01. Introduction
- Introduction
- What is Entity Framework Core?
02. Environment Setup
- Toolset Overview
- Install Visual Studio – Windows
- Install Visual Studio Code
- Install .NET Core and EF Core Tools
03. Getting Started with Entity Framework Core
- Setup Project Solution – Visual Studio
- Setup Project Solution – Visual Studio Code + Dotnet CLI
- What are Data Models?
- Creating the Data Models with EF Core
- Understanding the Database Context
- Adding a Database Context
- EF Core and Database Support
- Specifying the Data Provider and Connection String
- Understanding Code First Development and Migrations
- Setup Console App Project
- Adding a Migration
- Generating a Database (Code-First)
- Understanding Database First Development
- Reverse Engineer Existing Database
- Seeding Data
04. Using Entity Framework Core to Query a Database
- Adding Verbose Logging to EF Core’s Workload
- LINQ as Entity Framework Core Syntax
- Querying Basics
- Synchronous vs. Asynchronous Syntax
- Querying for a Single Record
- Add Filters to Queries
- Additional Filtering Features
- Alternative LINQ Syntax
- Aggregate Methods
- Group By
- Order By
- Skip and Take
- Projections and Custom Data Types
- Tracking Vs. No Tracking
- IQueryables vs List Types
- Efficient Querying Tips and Tricks
05. Using Entity Framework Core to Manipulate Data
- Understanding Tracking and Saving Changes
- Simple Insert Operations
- Simple Update Operations
- Simple Delete Operations
- ExecuteUpdate and ExecuteDelete
06. Handling Database Changes and Migrations
- Review Entity Framework Core Migrations
- Adding More Entities
- Updating Database with Migration(s)
- Using Configuration Files
- Generating Migration Scripts
- Rolling Back Migrations and Database Changes
- EF Bundles
- Applying Migrations at Runtime
07. Interacting With Related Records
- Database Relationships and Entity Framework Core
- One to Many Relationships
- Many to Many Relationships
- Understanding One-To-One Relationships
- Update Database With Relationships
- Inserting Related Data
- Understanding Loading Methods
- Including Related Data with Eager Loading
- Including Related Data with Explicit Loading
- Including Related Data with Lazy Loading
- Filtering on Related Records
- Projections and Anonymous Data Types
- Understanding Delete Behaviors
08. Working With Raw SQL, Views and Stored Procedures
- Adding Non-Table Objects with Migrations
- Querying Keyless Entities (Like Views)
- Querying with Raw SQL
- Querying scalar
- Executing User-defined Functions
- Limitations of Raw Queries and EF Core
09. ASP.NET Core and EF Core
- How EF Core and ASP.NET Core Work
- Create ASP.NET Core Project
- Connect to the Database Context
- Fixing EF Core Design Time Errors
- Scaffolding Code with Visual Studio
- Scaffolding Code with Visual Studio Code
- Exploring Scaffolded Code
- Review Best Practices
10. Additional Features and Considerations
- Manipulate Entries Before Saving Changes
- SQL Server Temporal Tables
- Data Validation with Data Annotations
- Pre-convention model configuration
- Support For Database Transactions
- Handling Data Concurrency Issues
- Using Query Filters
- Database Connection Retry and Timeout Policies