Entity Framework Core - A Full Tour

Video description

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.

What you will learn

  • Set up and configure your development environment for EF Core
  • Create, query, and manipulate databases using EF Core techniques
  • Understand and implement various database relationships and loading methods
  • Execute advanced querying with LINQ and raw SQL in EF Core
  • Integrate EF Core with ASP.NET Core for dynamic web applications
  • Manage database changes and migrations efficiently

Audience

This course is ideal for students eager to learn Entity Framework through practical, hands-on experience. It specifically caters to those who wish to understand the workings of EF Core in a focused manner, without the complexities of patterns and user interface design. Familiarity with C# will be crucial as it is the primary language used in conjunction with Entity Framework Core. Additionally, a basic grasp of database development is essential.

About the Author

Trevoir Williams: Trevoir Williams, a dynamic software and systems engineer, possesses an unwavering commitment to imparting his extensive knowledge to students worldwide. He boasts a robust academic background with a master's degree in computer science, specializing in Software Development, complemented by multiple Microsoft Azure Certifications.

Trevoir's illustrious career spans various roles, including software consulting, engineering, database development, cloud systems, and server administration. He also excels in academia as a lecturer and uniquely blends his technical expertise with his creative pursuits as a musician.

Dedicated to educating in IT and development, Trevoir excels in guiding students to acquire contemporary industry-relevant knowledge through practical application, ensuring they remain at the forefront of technological advancements.

Table of contents

  1. Chapter 1 : Introduction
    1. Introduction
    2. What is Entity Framework Core?
  2. Chapter 2 : Environment Setup
    1. Toolset Overview
    2. Install Visual Studio – Windows
    3. Install Visual Studio Code
    4. Install .NET Core and EF Core Tools
  3. Chapter 3 : Getting Started with Entity Framework Core
    1. Section Overview
    2. Setup Project Solution - Visual Studio
    3. Setup Project Solution - Visual Studio Code + Dotnet CLI
    4. What are Data Models?
    5. Creating the Data Models with EF Core
    6. Understanding the Database Context
    7. Adding a Database Context
    8. EF Core and Database Support
    9. Specifying the Data Provider and Connection String
    10. Understanding Code First Development and Migrations
    11. Setup Console App Project
    12. Adding a Migration
    13. Generating a Database (Code-First)
    14. Understanding Database First Development
    15. Reverse Engineer Existing Database
    16. Seeding Data
    17. Section Review
  4. Chapter 4 : Using Entity Framework Core to Query a Database
    1. Section Overview
    2. Adding Verbose Logging to EF Core's Workload
    3. Fix: Database Connection String Refactor
    4. LINQ as Entity Framework Core Syntax
    5. Querying Basics
    6. Synchronous vs. Asynchronous Syntax
    7. Querying for a Single Record
    8. Add Filters to Queries
    9. Additional Filtering Features
    10. Alternative LINQ Syntax
    11. Aggregate Methods
    12. Group By
    13. Order By
    14. Skip and Take
    15. Projections and Custom Data Types
    16. Tracking Vs. No Tracking (Enhancing Performance)
    17. IQueryables vs List Types
    18. Efficient Querying Tips and Tricks
    19. Section Review
  5. Chapter 5 : Using Entity Framework Core to Manipulate Data
    1. Section Overview
    2. Understanding Tracking and Saving Changes
    3. Simple Insert Operations
    4. Simple Update Operations
    5. Simple Delete Operations
    6. ExecuteUpdate and ExecuteDelete (>= EF Core 7)
    7. Section Review
  6. Chapter 6 : Handling Database Changes and Migrations
    1. Section Overview
    2. Review Entity Framework Core Migrations
    3. Adding More Entities
    4. Updating Database with Migration(s)
    5. Using Configuration Files
    6. Generating Migration Scripts
    7. Rolling Back Migrations and Database Changes
    8. EF Bundles
    9. Applying Migrations at Runtime
    10. Section Review
  7. Chapter 7 : Interacting With Related Records
    1. Section Overview
    2. Database Relationships and Entity Framework Core
    3. One to Many Relationships
    4. Adding One-To-Many Relationships
    5. View Diagram with Entity Framework Core Tools
    6. Many to Many Relationships
    7. Adding Many-To-Many Relationships
    8. Understanding One-To-One Relationships
    9. Adding One-To-One Relationships
    10. Update Database With Relationships
    11. Inserting Related Data
    12. Understanding Loading Methods
    13. Including Related Data with Eager Loading
    14. Including Related Data with Explicit Loading
    15. Including Related Data with Lazy Loading
    16. Filtering on Related Records
    17. Projections and Anonymous Data Types
    18. Understanding Delete Behaviors
    19. Section Review
  8. Chapter 8 : Working With Raw SQL, Views and Stored Procedures
    1. Section Overview
    2. Adding Non-Table Objects with Migrations
    3. Querying Keyless Entities (Like Views)
    4. Querying with Raw SQL - Part 1
    5. Querying with Raw SQL - Part 2
    6. Querying scalar
    7. Executing User-defined Funcitons
    8. Limitations of Raw Queries and EF Core
    9. Section Review
  9. Chapter 9 : ASP.NET Core and EF Core
    1. Section Overview
    2. How EF Core and ASP.NET Core Work
    3. Create ASP.NET Core Project
    4. Connect to the Database Context
    5. Fixing EF Core Design Time Errors
    6. Scaffolding Code with Visual Studio
    7. Scaffolding Code with Visual Studio Code
    8. Exploring Scaffolded Code
    9. Review Best Practices
    10. Section Review
  10. Chapter 10 : Additional Features and Considerations
    1. Section Overview
    2. Manipulate Entries Before Saving Changes
    3. SQL Server Temporal Tables
    4. Data Validation with Data Annotations
    5. Pre-convention model configuration
    6. Support For Database Transactions
    7. Handling Data Concurrency Issues
    8. Using Query Filters
    9. Database Connection Retry and Timeout Policies
  11. Chapter 11 : Conclusion
    1. Conclusion

Product information

  • Title: Entity Framework Core - A Full Tour
  • Author(s): Trevoir Williams
  • Release date: December 2023
  • Publisher(s): Packt Publishing
  • ISBN: 9781803242231