Created
January 13, 2011 01:39
-
-
Save jfromaniello/777257 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//IDataErrorInfo as a Mixed in implementation. | |
[MixIn(typeof(DataErrorInfoImpl)] | |
public class Person | |
{ | |
[Required] | |
public string FirstName{get;set;} | |
public string LastName {get;set;} | |
} | |
public class DataErrorInfoImpl : IDataErrorInfo | |
{ | |
public string this[string columnName]() | |
{ | |
// data annotations code to retrieve errors | |
} | |
public string Errors(){ //other code } | |
} | |
//produces: | |
public class Person | |
{ | |
[Required] | |
public string FirstName{get;set;} | |
public string LastName {get;set;} | |
string IDataErrorInfo.this[string columnName]() | |
{ | |
// data annotations code to retrieve errors | |
} | |
string IDataErrorInfo.Errors(){ //other code } | |
} | |
//Remove mixing attribute and reference from the assembly. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment