Stop Using In-Memory Data! Connect EF Core & SQL Server in .NET Aspire
Code Sprint
0:00 / 0:00
Stop Using In-Memory Data! Connect EF Core & SQL Server in .NET Aspire
29 просмотров · 15 ч назад
Code Sprint
3,08 тыс. подписчиков
29 просмотров · 15 ч назад
.NET Microservices Part - 10 | Entity Framework Core & SQL Server with .NET Aspire
In this episode of our **.NET Microservices tutorial series**, we take the next step in building our Catalog microservice by integrating **Entity Framework Core (EF Core) with SQL Server using .NET Aspire**.
So far, our Catalog API has used an in-memory data store. In this session, we start building the database foundation needed to persist product and category data using a code-first approach.
🚀 *What You'll Learn in This Video*
✅ What is Entity Framework Core (EF Core), and why do we need an ORM?
✅ Understanding Entities, DbContext, and Migrations
✅ Code-First vs Database-First approach
✅ Adding EF Core 10 and SQL Server packages
✅ Creating Product and Category entities
✅ Configuring entity relationships, primary keys, foreign keys, and navigation properties
✅ Using IEntityTypeConfiguration to keep database configuration separate from entity classes
✅ Configuring column lengths, decimal precision, indexes, and delete behavior
✅ Creating CatalogDbContext with DbSet and ApplyConfigurationsFromAssembly
✅ Integrating SQL Server with the .NET Aspire AppHost
✅ Creating the catalogdb database and passing the connection string securely to the Catalog API
✅ Understanding persistent containers, Docker data volumes, and database startup dependencies
🎯 *What We Are Building*
We are evolving our Catalog microservice towards a database-backed implementation using:
.NET 10 and C#
Entity Framework Core 10
SQL Server
.NET Aspire
Code-First approach
Product and Category entities
Central Package Management
By the end of this session, you'll understand the database integration foundation and how EF Core maps our C# entities to SQL Server tables.
📚 *Who Should Watch?*
This tutorial is for developers learning .NET 10, microservices, Entity Framework Core, SQL Server, and .NET Aspire through a practical, step-by-step project.
💻 *Follow the .NET Microservices Series*
Continue learning with our hands-on microservices project, where we build and improve real-world application architecture one step at a time.
If you find this video helpful, *LIKE, SHARE, and SUBSCRIBE* to support the channel!
💬 *Question for you:* Do you prefer the Code-First or Database-First approach in your projects? Share your experience in the comments.
#DotNet #Microservices #EntityFrameworkCore #DotNetAspire #DotNet10 #SQLServer #CSharp #CodeFirst