如何在mvc中显示来自fluentapi映射的验证消息?

时间:2016-01-22 12:16:54

标签: asp.net-mvc-4 entity-framework-5

流利的api映射:

 internal class ProjectMap :EntityTypeConfiguration<Project>
    {
            public ProjectMap()
        {
            HasKey(o => o.ProjectId);

            Property(p => p.ProjectId).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity);

            Property(p => p.StartDate < p.ExpectedEndDate);

            ToTable(TableSettings.Projects, TableSettings.DefaultSchema);
        }
    }

这里我想在startdate属性上显示错误消息。那么如何在客户端视图中显示它?

0 个答案:

没有答案