Model binding / ViewModel binding in ASP.Net Core MVC
Let's start with simple code: public class SomeViewModel { public int State { get; set; } } public class SomeController : Controller { public IActionResult DoSomething(int state) { var viewModel = new SomeViewModel(); if(state % 2 == 0) viewModel.State =…