asp.net mvc - MVC Entity Framework Annotation -
say have following code:
truck truck = new truck(); truck.id = '12323' return view(truck);
note entity truck has number of fields associated such color, note, etc.
for note, add annotation maxlength.
how go adding , annotation. know done in class in case, not have class getting truck directly entity framework.
you want make partial class (aka buddy class) entity class , give metadatatype attribute. check out example validation attributes. section labeled using data annotation validators entity framework.
Comments
Post a Comment