在visual studio 2013中,我有一个包含2个项目的解决方案:

-An entity framework project "database first" 
-A web api project with individual accounts authentication, with a reference to the entity framework project

在Sql Server中,我有一个现有的数据库,并且从数据库生成实体框架项目 . 现在在web api项目中,在Web.config中我输入了以下连接字符串:

<connectionStrings>
   <add name="StrokeInEntities" connectionString="metadata=res: ...... />
   <add name="DefaultConnection" connectionString="Data Source ....... />
</connectionStrings>

哪里:

  • DefaultConnection用于身份验证(并且web api在我现有的数据库中生成表dbo.AspNetUsers,dbo.AspNetUserRoles等...

  • StrokeInEntities连接用于从web api控制器访问现有表

现在的问题是,当我从我的web api控制器访问一个exsisting表时,我在db中看到发起了一个带有dbo前缀的新表 . 例如,如果我访问表“People”,db将创建一个新表dbo.People .

怎么能消除这种影响?