Why is my MVC ViewModel member overridden by my ActionResult parameter?
问题 Is this a bug or a feature? All code below has been simplified for the sake of brevity and easy replication and does not actually do anything useful other than highlight the behavior. I have a class that includes an int named ID: public class FooterLink { public int ID { get; set; } } In my controller, I have an Edit actionresult that takes a parameter called 'id': public ActionResult Edit(int id) { return View(new FooterLink() { ID = 5 }); //notice that I am explicitly setting the ID value