Entity Framework doesn't use users default schema

.net, c#, entity-framework, sql-server

Solution

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

Problem

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.

Original source