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