0

I have an EF model based on my database. Because the creator of the database gave the column the same name as the table, EF renamed the it and appended a 1 to it.

So I have table Cat with column Cat1.

When I run sql on the context with type Cat, it returns columns including the column Cat. Because there is no column Cat on my EF model, it throws an exception trying to map it.

Is there a fix for this? Unfortunately the query/method is generic so I must do select * from.

NibblyPig
  • 51,118
  • 72
  • 200
  • 356
  • 2
    Have you tried this? Using data annotations to use 'Cat' as the Column Name http://stackoverflow.com/questions/10554888/change-table-and-column-name-mappings-entity-framework-v4-3 – Adolfo Perez Aug 08 '13 at 16:53
  • Woah I have not, that's some pretty impressive stuff! I'll give it a shot, thanks – NibblyPig Aug 08 '13 at 16:55

0 Answers0