Getting Started with AutoMapper

If you are an experienced software developer you have no doubt written thousands of lines of code mapping properties of one object to properties of another object. This is commonly done when creating ViewModel objects or data transfer objects (DTOs). AutoMapper gives you a reusable, elegant solution to this problem. In this post, we will explore how AutoMapper does this. …

An In-Depth Look at ASP.NET MVC ModelState

If you have spent much time around ASP.NET MVC, you have no doubt used ModelState just like all other good little MVC developers. Have you ever peeked under the covers, though, and looked at why and how it works? In this post, we will do just that. What is ModelState? ModelState is, at its core, the values of a form …

An Introduction to the AntiForgeryToken HTML Helper

The ASP.NET MVC AntiForgeryToken HTML Helper is a widely used but not well-understood helper. In this post, I will look at the details of the helper, explain how it works, and how you should be using it.     What is the AntiForgeryToken Helper? The AntiForgeryToken helper protects your site from cross-site request forgery. Cross-site request forgery is the process …