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

ASP.NET Core MVC Finally Clicked for Me: Understanding How the Pieces Connect

When I first started working with ASP.NET Core MVC again, understanding each individual file wasn't necessarily the hardest part. The confusing part was understanding how everything connects. What exactly does…

Continue ReadingASP.NET Core MVC Finally Clicked for Me: Understanding How the Pieces Connect