C#
.NET
Backend-Development
Database

Database Access with Entity Framework Core

Almost no application gets by without database access. In this workshop you will learn the features of Entity Framework Core (EF Core) for practical use in both web and Windows applications, plus an insight into Azure storage technologies.

Programming Data Access Solutions with Entity Framework Core and C#

Duration: 3 days

Modern .NET applications need reliable, performant, and maintainable data access. This workshop teaches you how to use Entity Framework Core (EF Core) effectively in web, service, and desktop applications—covering current capabilities through EF Core 10 for relational and NoSQL providers.

Who Should Attend

  • .NET developers and architects building data-centric apps
  • Teams modernizing data access or migrating from EF6/ADO.NET
  • Engineers targeting SQL Server, PostgreSQL, SQLite, or Cosmos DB

Prerequisites

  • Solid C#/.NET experience; basic LINQ
  • Familiarity with relational database concepts
  • .NET SDK, Visual Studio or VS Code
  • Docker Desktop for local databases via Aspire integrations

Workshop Goals

  • Model domains with EF Core using conventions, data annotations, and Fluent API
  • Build efficient queries, avoid N+1 issues, and tune performance
  • Apply migrations, deployment, and CI/CD practices
  • Use modern EF Core features up to EF Core 10 previews (e.g., JSON columns, primitive collections, ExecuteUpdate/ExecuteDelete, raw SQL mapping to unmapped types, compiled models improvements)
  • Implement resiliency, transactions, and testing strategies

Topics

Foundations and Roadmap

  • EF Core architecture, providers, and lifecycle up to EF Core 10
  • DbContext setup, dependency injection, configuration options
  • Aspire integrations for spinning up local databases without manual installs

Modeling

  • Conventions, data annotations, and Fluent API
  • Relationships, keys, owned/complex types, shadow properties, field mapping
  • Inheritance: Table-per-Hierarchy (TPH), Table-per-Type (TPT), Table-per-Concrete-Type (TPC)
  • Table splitting and entity splitting
  • Mapping to JSON columns (SQL Server/SQLite) and primitive collections

Querying and Performance

  • LINQ to Entities fundamentals and projection patterns
  • Explicit/eager/lazy loading; avoiding N+1
  • Compiled queries and caching
  • Raw SQL queries and mapping to keyless/unmapped types
  • Pagination, filtering, sorting; server vs client evaluation

Changes and Persistence

  • Change tracking, tracking vs no-tracking queries
  • Inserts, updates, deletes; bulk operations with ExecuteUpdate/ExecuteDelete
  • Value converters, value comparers

Migrations and Deployment

  • Creating and applying migrations; schema evolution strategies
  • Seeding data; baseline and repeatable migrations

Transactions and Resiliency

  • Local and distributed/ambient transactions
  • Connection resiliency, retries, and timeouts
  • Concurrency tokens and optimistic concurrency handling

Advanced and Ecosystem

  • Interceptors and logging/diagnostics
  • Temporal tables, views, and stored procedures
  • Cosmos DB/NoSQL with EF Core
  • Performance profiling: logging events, dotnet-trace, and EF diagnostics
  • Using Aspire to orchestrate local database dependencies (SQL Server, PostgreSQL, Redis) for samples and tests

Testing

  • Testing with SQLite in-memory and providers; fakes vs real databases
  • Deterministic testing patterns for queries and changes

Outcomes

By the end of this workshop, you will be able to design, implement, and troubleshoot EF Core data access layers that are performant, testable, and ready for production across relational and NoSQL scenarios.

An unhandled error has occurred. Reload 🗙