不同的方式与实体框架连接 [英] different way to connect with entity framework

查看:141
本文介绍了不同的方式与实体框架连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

它的存在,我怎么能做出与实体框架,而不是在web.config中使用的连接字符串的数据库连接的另一种方式。也许传递参数到模型构建器或往的DbContext ????

It's there another way about how can I made the database connection with entity framework instead the use of connection string in the web.config. Maybe passing the parameters to the modelBuilder or to the DBContext????

推荐答案

我相信,你可以通过连接字符串中的参数到DataContext。你尝试过什么?为什么这样做?退房此链接

I do believe that you can pass connection string in the parameter to the DataContext. What have you tried? Why do this? check out this link

这篇关于不同的方式与实体框架连接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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