首页 新闻 会员 周边

codefirst fluent api怎么给表的字段添加说明

0
悬赏园豆:10 [已关闭问题] 关闭于 2015-01-03 19:58

比如我的某个Configuration是这么写的:

public class TemplateConfiguration : EntityTypeConfiguration<Template>
    {
        /// <summary>
        /// 构造函数
        /// </summary>
        public TemplateConfiguration()
        {
            HasKey(x => x.Id);
            Property(x => x.Id)
                .IsRequired()
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);
            Property(x => x.ClassId)
                .IsRequired();
            Property(x => x.Name)
                .IsRequired()
                .HasMaxLength(50);
            Property(x => x.Content)
                .IsRequired()
                .HasMaxLength(null);
            Property(s => s.AddDate)
                .IsRequired();
            HasRequired(a => a.TemplateClass).WithMany(c => c.Templates).HasForeignKey(a => a.ClassId);
        }
    }

请问我需要怎么写,才能在生成数据表的时候,把表的字段的描述添加进去?

谢谢。谢谢。谢谢。谢谢。

问题补充:

是没人知道,还是没办法,还是不屑回答??

屌丝大叔的笔记的主页 屌丝大叔的笔记 | 初学一级 | 园豆:2
提问于:2014-12-10 10:34
< >
分享
所有回答(1)
0

不知道,我也想知道!

hghrpg | 园豆:206 (菜鸟二级) | 2019-03-17 16:21
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册