【发布时间】:2014-06-15 21:24:31
【问题描述】:
我有一个使用数据注释定义的模型
public int Id { get; set; }
[Required, MaxLength(50)]
public string Title { get; set; }
[Required, StringLength(2000,MinimumLength = 300)]
public string Description { get; set; }
[Required,Range(10,500)]
public int Budget { get; set; }
我发现微风元数据无法正确获取描述(最小长度)和预算(最小和最大长度范围)的注释。并且由于这种微风验证无法在客户端上正常工作。这是上述模型的微风元数据
property: [
{
name: "Id",
type: "Edm.Int32",
nullable: "false",
annotation:StoreGeneratedPattern: "Identity"
},
{
name: "Title",
type: "Edm.String",
maxLength: "50",
fixedLength: "false",
unicode: "true",
nullable: "false"
},
{
name: "Description",
type: "Edm.String",
maxLength: "300",
fixedLength: "false",
unicode: "true",
nullable: "false"
},
{
name: "Budget",
type: "Edm.Int32",
nullable: "false"
}
]
请推荐
【问题讨论】:
标签: entity-framework breeze data-annotations