I want to create a buddy class, for the autogenerated Designer.cs in Datafirst Entity Framework, to implement validations with dataannotations.
The solutions I found on google contains examples with simple properties like
public int EmpID
{get;set;}
whereas the properties generated in designer.cs contains some logic in it. for ex-
/// <summary>
/// No Metadata Documentation available.
/// </summary>
[EdmScalarPropertyAttribute(EntityKeyProperty=false, IsNullable=false)]
[DataMemberAttribute()]
public global::System.Byte RoleID
{
get
{
return _RoleID;
}
set
{
OnRoleIDChanging(value);
ReportPropertyChanging("RoleID");
_RoleID = StructuralObject.SetValidValue(value);
ReportPropertyChanged("RoleID");
OnRoleIDChanged();
}
}
Please guide on how to create a buddy class for properties like the one mentioned above.