问题是,我想在 POCCO Enitites 中实现数据注释但是在“edmx update”之后,我的所有验证都被删除了,为此,我为下面的示例进行了研发,但没有成功。我和大家分享了我的senerio,请有人回答。
POCCO 实体
namespace FGSMVC
{
using System;
using System.Collections.Generic;
public partial class DeclaredBill
{
public DeclaredBill()
{
this.DeclaredBillReciepts = new HashSet<DeclaredBillReciept>();
}
public string DocNo { get; set; }
public string BCCode { get; set; }
public string BillNo { get; set; }
public Nullable<System.DateTime> BillDate { get; set; }
public string PONumber { get; set; }
public string CustomerCode { get; set; }
public Nullable<double> Amount { get; set; }
public bool IsPaid { get; set; }
public bool IsActual { get; set; }
public virtual BusinessConcern BusinessConcern { get; set; }
public virtual ICollection<DeclaredBillReciept> DeclaredBillReciepts { get; set; }
public virtual PartyDetail PartyDetail { get; set; }
}
}
我的模特班
namespace FGSMVC.Models
{
[MetadataType(typeof(DeclaredBillModel))]
public partial class DeclaredBill
{
}
public class DeclaredBillModel
{
[Display(Name = "Doc No")]
public string DocNo;
[Display(Name = "Business Concern")]
public string BCCode;
[Display(Name = "Bill #")]
public string BillNo;
[Display(Name = "Bill Date")]
public Nullable<System.DateTime> BillDate;
[Display(Name = "PO #")]
public string PONumber;
[Display(Name = "Customer")]
public string CustomerCode;
[Display(Name = "Amount")]
public Nullable<double> Amount;
[Display(Name = "Paid")]
public bool IsPaid;
[Display(Name = "Acutal")]
public bool IsActual;
}
}
请有人解决我的问题,我遇到了麻烦,在我看来标签必须显示为显示名称数据注释