简体   繁体   English

实例化时找不到数据库对象实例化

[英]Database object instantiate not found while instantiating

I have a connection to database (Postgressql) and in the server explorer i can see it and connect to it but i can not instantiate it in my controller 我已经连接到数据库(Postgressql),并且在服务器资源管理器中我可以看到它并连接到它,但是我无法在控制器中实例化它

 public CentralEntities testDB = new CentralEntities();

the name is CentralEntities,and i get this error which says CentralEntities has not been found are you missing a reference ?strange thing is it used to work till yesterday 名称是CentralEntities,我收到这个错误消息,提示您找不到参考,找不到CentralEntities吗?奇怪的是,它一直工作到昨天

通过大卫的提示,发现缺少自动生成的类,通过使用备份将其添加到项目中,问题得以解决

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM