开发者

How does the Entity Framework handle SQL Server Schemas?

开发者 https://www.devze.com 2023-01-07 16:14 出处:网络
We are developing an application against a SQL Server 2005 database that uses several schemas for security purposes. The application will be using EF 2 in the .NET 4.0 framework.

We are developing an application against a SQL Server 2005 database that uses several schemas for security purposes. The application will be using EF 2 in the .NET 4.0 framework.

What I'm wondering is how those SQL Schemas (Support, Admin, Employee) etc. can/will/should be represented on the EF side. Should I separate the various entities into separate models (edmx files) in the application to reflect the SQL s开发者_如何学运维chemas? I'm not as concerned about name conflicts as much as understanding the model more intuitively.

What are the recommendations or best practices in this area?

Thanks!


you could decorate your class with TableAttribute if you are using attribute based mapping.

Generally speaking table in one schema is a different entity than table in another schema, so reflecting that you could group your classes in respective namespaces.

0

精彩评论

暂无评论...
验证码 换一张
取 消