MVC4 EntityFramework代码优先上下文连接 [英] MVC4 EntityFramework Code-first context connection

查看:100
本文介绍了MVC4 EntityFramework代码优先上下文连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从控制器向导创建上下文时,它会自动为我创建我希望找到连接字符串的所有内容以及我如何追加它

when i create context from controller wizard it automatic create for me every thing i want to find out where connection string and how i can append it

推荐答案

当我首先用代码创建它,所以连接字符串部分我什么都没发现

当我调试上下文db我发现这样的连接字符串

Data Source = .\\ SQLEXPRESS;初始目录= MvcApplication3.Models.dbContext; Integrated Security = True; MultipleActiveResultSets = True; Application Name = EntityFrameworkMUE



我在dblexpress的db中找到了离开以改变实体向导的连接行为



http://s16.postimg.org/ezy2evumd/New_Bitmap_Image_2.png





我的意思是



实体向导
when i create it with code first and so connection string section i found nothing
and when i debug context db i found connection string like this
"Data Source=.\\SQLEXPRESS;Initial Catalog=MvcApplication3.Models.dbContext;Integrated Security=True;MultipleActiveResultSets=True;Application Name=EntityFrameworkMUE"

and i found in db in sqlexpress is there away to change the behavior of entity wizard for connection

http://s16.postimg.org/ezy2evumd/New_Bitmap_Image_2.png


that what i mean by

entity wizard


这篇关于MVC4 EntityFramework代码优先上下文连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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