Created
January 8, 2013 14:56
-
-
Save HeathHopkins/4484370 to your computer and use it in GitHub Desktop.
Demo of extending EF classes and adding metadata.
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; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| using System.ComponentModel; | |
| using System.ComponentModel.DataAnnotations; | |
| using DataAnnotationsExtensions; | |
| namespace MobileAPI.Models | |
| { | |
| [MetadataType(typeof(FeedbackMetadata))] | |
| public partial class Feedback | |
| { | |
| } | |
| public class FeedbackMetadata | |
| { | |
| [DisplayName("Name")] | |
| [PlaceHolder("Name")] | |
| [Required(ErrorMessage = "*")] | |
| public string name { get; set; } | |
| [Email] | |
| [DisplayName("Email")] | |
| [PlaceHolder("Email")] | |
| [Required(ErrorMessage = "*")] | |
| public string email { get; set; } | |
| [AllowHtml] | |
| [DisplayName("Comment")] | |
| [PlaceHolder("Comment")] | |
| [Required(ErrorMessage = "*")] | |
| public string comment { get; set; } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment