I have a property in a dto that I don't want the modelbinder/view to use the get on? Is there an attribute I can decorate it with to stop them from interrogating it?
Thanks
I have a property in a dto that I don't want the modelbinder/view to use the get on? Is there an attribute I can decorate it with to stop them from interrogating it?
Thanks
See the "Include" and "Exclude" properties on the BindAttribute:
http://msdn.microsoft.com/en-us/library/system.web.mvc.bindattribute_members.aspx
public class Model
{
[Bindable(false)] // this is the attribute you can use...
public int ModelId { get; set; }
}