別のSO投稿に関連して、「新しい」列ActiveBoolがデータベーステーブルと照合されないようにモデルを更新する必要があります。
モデル:
public class StatusList
{
[Key]
public int StatusID { get; set; }
[Required]
public byte Active { get; set; }
//I want this column to be ignored by Entity Framework
public bool ActiveBool
{
get { return Active > 0; }
set { Active = value ? Convert.ToByte(1) : Convert.ToByte(0); }
}
}
使用できるDataAnnotationはありますか?