Metadatatype support ?

Feb 26, 2009 at 9:40 AM
Is it possible to put attributes on a MetadataType class ?

public class Person
  public string Name {get;set;}

public class PersonMetaData
  public string Name { get;set; }

Because in Linq 2 SQL, classes and properties are generated and attributes can not easily be added ???
Mar 3, 2009 at 4:52 PM
Sorry, I don't have any direct experience with MetadataType classes so I can't answer your question. You could always programmatically register validators on the properties:

typeof(PersonMetaData).GetProperty("Name").AddValidation(new [] {new NotNull()});