I have the following class in my Entity framework Code First context
public class DataBinding
{
[Key]
public DataSource Source
{ get; set; }
[Key]
public DataType Type
{ get; set; }
.....
}
Both DataSource
and DataType
are part of the same context, but when i try to create the database i get the following error EntityType 'DataBinding' has no key defined. Define the key for this EntityType.
DataBindings: EntityType: EntitySet 'DataBindings' is based on type 'DataBinding' that has no keys defined.
i have defined two keys why am i getting this error?