Pardon me for my noob question but I notice that the bind attribute does not appears as default in controller template anymore for MVC 6.
I know I that the attribute is still present but do we still need to use them? I heard they can be use to prevent over-posting attack. Do they remove it because MVC 6 can figure out the way to prevent this without using them? Or is there a more secure way to prevent that?
The best way to prevent overposting is to get the entity, update only the properties needed to update and save it.
Assuming you have a view model like
And assume there is a view called Update which shows
UserName
in readonly/display only form andFirstName
andLastName
in editable fields. So even if user posts an updated UserName via some means, we should not be updating that field value.