无法将DataContext添加到新Controller [英] Unable to add DataContext to new Controller

查看:91
本文介绍了无法将DataContext添加到新Controller的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

只需在我的asp mvc4中添加一个实体框架即可。我使用代码生成器来添加上下文和类。但是,当我想添加一个控制器时,我无法选择我创建的datacontext?

Just add a entity framework to my asp mvc4. I used the code generator to add the context and classes. However when i want to add a controller, i am unable to select the datacontext i created?

推荐答案

datacontext一直存在,我没有意识到这个名字该文件的类别与它所持有的继承dbcontext形式的类不同。
the datacontext was there all along, i did not realise that the name of the file is different to the class it holds which inherits form dbcontext.


这篇关于无法将DataContext添加到新Controller的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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