With Entity Framework and Code First, is it possible to create and use a table without primary keys? I can not get this installation to work:
public class Report
{
public virtual int ReportId
public virtual ICollection<ReportChanges> ReportChanges
}
public class ReportChanges
{
public virtual Report Report
public virtual string EditorName
public virtual DateTime Changed
}
Note that I excluded the primary key assignment in ReportChanges. But with this setting, I get: "It is not possible to derive a key for the" ReportChanges "object type.
Either I'm missing something, or Code First does not support tables without primary keys. What is right? Thank.
source
share