Created
October 13, 2011 05:05
-
-
Save elleryq/1283434 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
| using System.ComponentModel.DataAnnotations; | |
| [MetadataType(typeof(MemberMetadata))] | |
| public partial class Member | |
| { | |
| private class MemberMetadata | |
| { | |
| public int ID { get; set; } | |
| [Required(ErrorMessage="Please input account")] | |
| [StringLength(50,ErrorMessage="Don't over 50 characters")] | |
| [DisplayName("Account")] | |
| public string Account { get; set; } | |
| } | |
| } | |
| // You can also use RegularExpression, Range... these attributes to annotation properties. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment