EF Core Migrations Finally Explained: What Add-Migration and Update-Database Actually Do

When I first saw EF Core migrations, I knew the commands: Add-Migration InitialCreate Update-Database But knowing the commands and understanding what they actually do are two different things. For a…

Continue ReadingEF Core Migrations Finally Explained: What Add-Migration and Update-Database Actually Do

Why I Use a ViewModel Instead of Sending My EF Core Entity Directly to a View

When I first learned ASP.NET Core MVC, one thing confused me: If I already have an EF Core entity with all my database fields, why would I create another class…

Continue ReadingWhy I Use a ViewModel Instead of Sending My EF Core Entity Directly to a View

ASP.NET Core Model Validation Finally Made Sense to Me: Data Annotations and ModelState

When I first started working with forms in ASP.NET Core MVC, validation looked simple. You add [Required] to a property, ASP.NET somehow knows the field is required, and an error…

Continue ReadingASP.NET Core Model Validation Finally Made Sense to Me: Data Annotations and ModelState