I have a simple one to many relationship between my PolicyVIEInfo class TriggerInfo class. I would like to include the PolicyVIEInfo_Id attribute in the TriggerInfo class but when I add the property I get
Invalid column name 'PolicyVIEInfo_Id1'. I'm assuming it is adding the one because it already knows about the foreign key, but how do I add it to my class and map it properly ??
[DataContract]
public class PolicyVIEInfo : IdentifiableEntity
{
[DataMember]
public HashSet<TriggerInfo> TriggerInfos { get; set; }
}
[DataContract]
public class TriggerInfo : IdentifiableEntity
{
[DataMember]
[Required]
public long PolicyVIEInfo_Id { get; set; }
[DataMember]
public bool? TriggerBreached { get; set; }
}
[DataContract]
public abstract class IdentifiableEntity
{
[DataMember]
[Key]
public long Id { get; set; }
}
I don't want to include the entire PolicyVIEInfo because of circular reference problems. Any help would be greatly appreciated this has been driving me nuts for days. Using fluent api hasn't helped. From what I've read I am using regular conventions so I thought it would just work.