android
android

Reputation: 652

Entity Framework doesn't use users default schema

On my SQL Server I have a user called "preview" which has the default schema "preview". Even though I have this user in my connection string, the Entity Framework always uses the dbo schema. Is this normal behaviour or is something wrong with my SQL server configuration?

I know I could define a different schema with the TableAttribute or the ModelBuilder but I really try to avoid that.

Upvotes: 4

Views: 3179

Answers (1)

Jurica Smircic
Jurica Smircic

Reputation: 6445

Yes for EF version <=5. There will be new features in EF6 to achieve what you need. See here for explanation, under DbModelBuilder.HasDefaultSchema

http://entityframework.codeplex.com/wikipage?title=specs

Upvotes: 3

Related Questions