简体   繁体   English

Entity Framework 5 或 6 是否支持 SQL 服务器同义词?

[英]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.使用 SQL 服务器同义词和 EF 告诉我它在被同义词引用时找不到数据库对象。 Are synonyms supported in current versions of EF?当前版本的 EF 是否支持同义词?

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. EF 工具都不了解同义词,因此您将无法以正常方式使用迁移或逆向工程。 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.但在运行时,EF 不会验证数据库是否为每个实体提供了一个物理表,您可以自由配置 EF 实体以读取/写入视图或同义词。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM