AnantLabs / codesmith

Automatically exported from code.google.com/p/codesmith
1 stars 0 forks source link

Generate DataAnnotations for Entity Framework (PLINQO) #614

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Please, can you add the following to the PLINQO EF tempalte:
when generating Edmx classes, add internal Metadata in each class containing 
all available DataAnnotations to properties.

ex:

using System.ComponentModel;
using System.ComponentModel.DataAnnotations;

namespace MvcApplication1.Models
{
    [MetadataType(typeof(MovieMetaData))]
    public partial class Movie
    {
    public class MovieMetaData
    {
        [Required]
        public object Title { get; set; }

        [Required]
        [StringLength(5)]
        public object Director { get; set; }

        [DisplayName("Date Released")]
        [Required]
        public object DateReleased { get; set; }
    }

    }

}

Original issue reported on code.google.com by AhmedDek...@gmail.com on 28 Nov 2011 at 7:41

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 29 Nov 2011 at 1:32