我有以下两种型号:
class Parent {
static yell() {
console.log('yell')
}
}
class Child extends Parent {
}
Child.yell();
一旦"警报"对象属性中包含值,我试图使用EntityFramework将此对象嵌入到我的SQL DB中,如下所示:
public class Alert
{
public int Id { get; set; }
public DateTime AlertDatetime { get; set; }
public bool Unread { get; set; }
public int? ReadByUserId { get; set; }
public DateTime? ReadDateTime { get; set; }
public DateTime ImportDateTime { get; set; }
public bool AlertHasRecords { get; set; }
//Error Reporting and Recording.
public bool Error { get; set; }
public string ErrorText { get; set; }
public virtual IEnumerable<AlertRecord> Records { get; set; }
}
public class AlertRecord
{
public int Id { get; set; }
public string HospitalNumber { get; set; }
public string ForeName { get; set; }
public string SurName { get; set; }
public DateTime DateOfBirth { get; set; }
public DateTime EventDateTime { get; set; }
public string CrisNumber { get; set; }
public DateTime CreationDateTime { get; set; }
//Link it back to the master Alert!
public int AlertId { get; set; }
public virtual Alert Alert { get; set; }
}
AlertObjectFactory.cs和负责构建AlertRecords列表的类在这里(它们是大类文件) https://gist.github.com/anonymous/67a2ae0192257ac51f39
&#34;警报&#34;表中正在填充数据,但是有4条记录 IEnumerable Records 没有被插入...
EF可以实现此功能吗?