c# - Metadata attributes not being applied in Database-First Entity Framework -


i've spent 2 days scouring internet i'm doing wrong. every tutorial , question/answer here shows same solution :

[metadatatype(typeof(people_metadata))] public partial class people { }  public class people_metadata {     [displayname("social security number")]     public string ssn { get; set; } } 

the problem isn't working me. when crawl through properties people class in view, ssn property shows no attributes nor customattributes. can see people class has metadatatype attribute. i've tried separating classes separate files, same file, metadata class inside partial, 2 separate, setting metadata class partial, internal, sealed, public, everything. have literally no idea why isn't working me, when accounts ought to.

please me.

the people class below :

public partial class people {     public int id { get; set; }     public string ssn { get; set; }     public string name { get; set; } } 

it may worth emphasizing i'm trying see metadata attributes of properties through reflection. more research showed me how pull out metadata attribute , reflect metadata class, people_metadata, i'd prefer minimizing amount of reflection crawling being done.

this works

internal sealed class agencyreferredtometadata {     //since used in modal, using error text      //of validationsummary not validationmessagefor     [required(errormessage = "agencyreferredto required.")]     public string agencyreferredto1 { get; set; }  }  //http://stackoverflow.com/questions/14059455/adding-validation-attributes-with-an-entity-framework-data-model [system.componentmodel.dataannotations.metadatatype(typeof(agencyreferredtometadata))] public partial class agencyreferredto : ientity 

Comments

Popular posts from this blog

java - Jasper subreport showing only one entry from the JSON data source when embedded in the Title band -

mapreduce - Resource manager does not transit to active state from standby -

serialization - Convert Any type in scala to Array[Byte] and back -