Favor Top-Down Domain Modeling in ASP.NET with Entity Framework Core



Favor Top-Down Domain Modeling in ASP.NET with Entity Framework Core

Favor Top-Down Domain Modeling in ASP.NET with Entity Framework Core

This tutorial will teach you the merits of applying the top-down development style when developing one isolated feature in an ASP.NET Core application backed by Entity Framework Core and SQL Server.
You will learn how to combine top-down development with another valuable development technique – vertical slicing, where we try to implement the smallest possible part of a feature, but implement it through all the layers of the application – from the Razor page at the top, all the way down to Entity Framework, persistence model and, via migrations, to actual tables and columns in the database.
By combining top-down development with incremental nature of vertical slicing, you will be able to implement even the most complex features without ever causing confusion or slowdown in the development process, let alone make bugs.
In this video, we are continuing development of an existing ASP.NET application with Entity Framework Core. The current goal is to develop a feature requested by the customers. Through the coding session, you will witness the building of the requested feature one step at the time, going in tiny increments. The first step is to implement the top-most layer, the Razor page, with the correctly formed HTML filled with Lorem Ipsum content. Once we can confirm that this top-most layer is operational, we step one layer down, into the Razor page’s backing model, where we implement a data prototype that will be used to populate the Razor page above. This step will mark completion of the Razor page (not the page model, yet!). Thanks to the top-level development style, we will never even open the Razor page until the end of the demonstration.
The development will continue further, by defining the view model that will be used by the page model, then developing the domain model and mapping it into the view model for display, ending in constructing the Entity Framework mapping of the domain model into the persistence model. With Entity Framework migration added to the project and applied to the underlying database, the top-down development of the requested feature will be over.

Learn more from video courses:
Beginning Object-oriented Programming with C# ► https://codinghelmet.com/go/beginning-oop-with-csharp
Collections and Generics in C# ► https://codinghelmet.com/go/collections-and-generics-in-cs
Making Your C# Code More Object-oriented ► https://codinghelmet.com/go/making-your-cs-code-more-oo

Other courses at Pluralsight ► https://codinghelmet.com/go/pluralsight
Other courses at Udemy ► https://codinghelmet.com/go/udemy

Other videos on this channel you may be interested in watching:
Using GitHub Copilot to Write Complex Code | Step-by-step Tutorial ► https://youtu.be/XktMg5jnaBI
Coding with GitHub Copilot – Beginner to Master | VS Code Demo ► https://youtu.be/B9DKv09IfT4
What is Covariance and Contravariance in C# ► https://youtu.be/Wp5iYQqHspg
How to Initialize a Clean ASP.NET Core Project with Entity Framework Core and Identity ► https://youtu.be/3NGz1G_HF94
The Null Conundrum: A Guide to Optional Objects in C# ► https://youtu.be/8-2xr_kBRnQ

#oop #entityframeworkcore #aspnetcore

Comments are closed.