实体框架和SQL Server同义词 [英] Entity Framework and SQL Server Synonyms

查看:191
本文介绍了实体框架和SQL Server同义词的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

匆忙的研究告诉我,即使EF4仍然不支持SQL Server同义词。我设置基于同义词的实体集的选项是什么,就好像它是一个基于表的实体集?我想出的最重要的是复制同义词的底层表,将其添加到我的模型中,然后重命名商店模型中的实体集。有没有更优雅的解决方法使用POCO或代码优先的方法?

解决方案

看到这篇文章 - 显然你可以做到一些手工操作的edmx。



使实体框架模型跨越多个数据库



虽然不优雅,但它并没有回答您的问题:-)


Hasty research tells me that even EF4 still doesn't support SQL Server synonyms. What are my options for setting up a synonym based entity set as if it were a table based entity set? The crudest I have come up with is to copy the underlying table for the synonym, add it to my model, and then rename the entity set in the store model. Is there no more elegant workaround using the POCO or code-first approach?

解决方案

See this post - apparently you can do it with some manual manipulation of the edmx.

Making an Entity Framework Model span multiple databases

It's not elegant, though, so it doesn't answer your question :-)

这篇关于实体框架和SQL Server同义词的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆