I get an error for define DbGeography in EF6 (i don't have this Error in EF5) entity type if I use it from base class to define key: for this class :
public class University
{
public int UniversityID { get; set; }
public string Name { get; set; }
public DbGeography Location { get; set; }
}
everything is correct and EntityFramework do it correctly
but if I change class to :
public class BaseClass
{
public int UniversityID { get; set; }
}
public class University:BaseClass
{
public string Name { get; set; }
public DbGeography Location { get; set; }
}
I get the following error:
One or more validation errors were detected during model generation:
Data.DbGeography: : EntityType 'DbGeography' has no key defined. Define the key for this EntityType. DbGeographies: EntityType: EntitySet 'DbGeographies' is based on type 'DbGeography' that has no keys defined.
[Stack Overflow](http://stackoverflow.com/questions/18121046/entitytype-dbgeography-has-no-key-defined-define-the-key-for-this-entitytype)
!!!??? Thanks
public class University
{
public int UniversityID { get; set; }
public string Name { get; set; }
public DbGeography Location { get; set; }
}
everything is correct and EntityFramework do it correctly
but if I change class to :
public class BaseClass
{
public int UniversityID { get; set; }
}
public class University:BaseClass
{
public string Name { get; set; }
public DbGeography Location { get; set; }
}
I get the following error:
One or more validation errors were detected during model generation:
Data.DbGeography: : EntityType 'DbGeography' has no key defined. Define the key for this EntityType. DbGeographies: EntityType: EntitySet 'DbGeographies' is based on type 'DbGeography' that has no keys defined.
[Stack Overflow](http://stackoverflow.com/questions/18121046/entitytype-dbgeography-has-no-key-defined-define-the-key-for-this-entitytype)
!!!??? Thanks