0
こんにちは私はこのようなエンティティフレームワークでクラスを持っている: -Entity Frameworkの無効な列名エラー
public partial class JLLContact : DomainEntity, IUniqueId
{
// Simple Props
public int? Record1ObjectTypeCode { get; set; }
public int? Record2ObjectTypeCode { get; set; }
public DateTime? CreatedOn { get; set; }
public string Email { get; set; }
public string Description { get; set; }
public bool IsActive { get; set; }
public int JLLContactId { get; set; }
public DateTime? ModifiedOn { get; set; }
public string Name { get; set; }
public string Title { get; set; }
public int? RoleLid { get; set; }
public int? BusinessLineLId { get; set; }
public int? RegionLId { get; set; }
public int? RelationScoreLId { get; set; }
public int? RelationStrengthLId { get; set; }
public int? Record1LId { get; set; }
public int? Record2LId { get; set; }
public bool? IsPrimary { get; set; }
public int? CountryLid { get; set; }
// UniqueId
public string __Id
{
get { return JLLContactId.ToString(); }
}
// Parents
public virtual ListItem Role { get; set; }
public virtual ListItem Region { get; set; }
public virtual ListItem Country { get; set; }
public virtual ListItem BusinessLine { get; set; }
}
私はDBへのこのタイプのエントリを追加しようと、私はエラーを取得します。列名 "BusinessLine_ListItemId"、 "Country_ListItemId"、 "Region_ListItemId"が無効です。明らかに彼らは親のプロパティを参照しています。しかし、私はこの問題を理解していません。誰でも正しい方向に向けることができます。
このコードファーストモデルはありますか? 'ListItem'エンティティと設定(存在する場合)を見ることができますか? –
@IvanStoev - あなたが正しいです。答えはマッピングファイルにあります。私は以下の変更を加え、変更を加えました。 – SaiBand