Does Entity Framework 5 or 6 support SQL Server Synonyms?

Viewed 176

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?

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.

Related