Is ASP.NET MVC a ViewModel / Dto property attribute that causes modelbinder / view to ignore it?

I have a property in dto that I don't want modelbinder / view to use get? Is there an attribute that I can decorate to stop them from polling?

thank

+3
source share
2 answers
public class Model
{
  [Bindable(false)] // this is the attribute you can use...
  public int ModelId { get; set; }
}
+3
source

See the Include and Exclude properties in the BindAttribute:

http://msdn.microsoft.com/en-us/library/system.web.mvc.bindattribute_members.aspx

0
source

Source: https://habr.com/ru/post/1746593/


All Articles