validation - Validating properties in c# -


let's suggest got interface , inherit class it,

internal interface ipersoninfo {     string firstname { get; set; }     string lastname { get; set; } } internal interface irecruitmentinfo {     datetime recruitmentdate { get; set; } }  public abstract class collaborator : ipersoninfo, irecruitmentinfo {     public datetime recruitmentdate     {         get;         set;     }     public string firstname     {         get;         set;     }     public string lastname     {         get;         set;     }     public abstract decimal salary     {         get;     } } 

then how validate strings in collaborator class? possible implement inside properties?

or use dataannotations

http://msdn.microsoft.com/en-us/library/system.componentmodel.dataannotations.validationattribute.aspx


Comments

Popular posts from this blog

python - Scipy curvefit RuntimeError:Optimal parameters not found: Number of calls to function has reached maxfev = 1000 -

c# - How to add a new treeview at the selected node? -

java - netbeans "Please wait - classpath scanning in progress..." -