Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Does Entity Framework 5 or 6 support SQL Server Synonyms?

Using SQL Server Synonyms and EF is telling me it can't find database objects when referenced by a synonym. Are synonyms supported in current versions of EF?

like image 315
LeWoody Avatar asked Feb 21 '26 15:02

LeWoody


1 Answers

Sort of. None of the EF tooling understands about synonyms, so you won't be able to use migrations or reverse engineering in the normal way. But at runtime EF doesn't validate that the database has a physical table for each entity, and you are free to configure an EF entity to read/write to a view or a synonym.

like image 56
David Browne - Microsoft Avatar answered Feb 23 '26 06:02

David Browne - Microsoft