|
EF не может найти ключевое поле в модели
|
|||
---|---|---|---|
#18+
Здравствуйте, уважаемые! Помогите побороть глюк. Есть модель: Код: c# 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13.
И есть аналогичная таблица Flats в базе с ключевым полем FlatNum int, not null, identity=false Но модель к таблице не привязывается. При выполнении: public DbSet<Flat> Flats { get; set; } возникает ошибка: \tSystem.Data.Entity.Edm.EdmEntityType: : EntityType 'Flat' has no key defined. Define the key for this EntityType. \tSystem.Data.Entity.Edm.EdmEntitySet: EntityType: EntitySet 'Flats' is based on type 'Flat' that has no keys defined. Почему аттрибут [Key] не помогает? ... |
|||
:
Нравится:
Не нравится:
|
|||
08.05.2013, 12:40 |
|
|
start [/forum/topic.php?fid=17&fpage=26&tid=1350032]: |
0ms |
get settings: |
11ms |
get forum list: |
14ms |
check forum access: |
4ms |
check topic access: |
4ms |
track hit: |
44ms |
get topic data: |
12ms |
get forum data: |
2ms |
get page messages: |
28ms |
get tp. blocked users: |
2ms |
others: | 14ms |
total: | 135ms |
0 / 0 |