У меня есть два класса сущностей:
namespace PowerSupply.Domain
{
[Table("Accounts")]
public class Account
{
public int Id;
public string CompanyName;
public float Interval;
}
}
И
namespace PowerSupply.Domain
{
public class ContactInfo
{
public int Id { get; set; }
public string mobileNo { get; set; }
public virtual Account Account { get; set; }
}
}
И мой DbContext:
public class PowerSupplyDBContext : DbContext
{
public PowerSupplyDBContext() : base("PowerSupplyDatabase")
{
}
public DbSet<Account> Acounts { get; set; }
public DbSet<ContactInfo> ContactInfo { get; set; }
}
Когда я пытаюсь включить-миграцию, яполучаю следующую ошибку:
One or more validation errors were detected during model generation:
PowerSupply.Persistance.Facade.Account: : EntityType 'Account' has no key defined. Define the key for this EntityType.
Acounts: EntityType: EntitySet 'Acounts' is based on type 'Account' that has no keys defined.
Я изучил и прочитал этот дубликат.Все имущество установлено для общественности.Есть идеи?