Hello,
Let's say I've a partial class generated by Linq2Sql.Let's say the generated class has 2 properties LastName and FirstName. How do I add attributes to its properties using an other partial class?
Thanks for helping.
Hello,
Let's say I've a partial class generated by Linq2Sql.Let's say the generated class has 2 properties LastName and FirstName. How do I add attributes to its properties using an other partial class?
Thanks for helping.
Ex:
[MetadataType(typeof(MyClassMetadata)]
public partial class MyClass
{
public class MyClassMetadata
{
[StringLength(30)]
public string FirstName {get;set;}
[StringLength(30)]
[Required]
public string LastName {get;set;}
}
}