实体框架ASP.NET [英] Entity Framework ASP.NET

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

问题描述

Hi Code Project Team,









我有在实体框架中存在疑问目前我在ASP.NET实体框架中工作当前项目基础设施是3层架构。



1.在业务逻辑层我创建了一个从数据库中获取记录的方法。

2.在使用上面类的obj的ASP.NET web项目中,我在后面的aspx.cs代码中调用该方法。在aspx.cs代码中,我使用以下名称空间调用此引用



1.使用System.Data.Entity;

2.使用System.Data.Entity.Infrastructure;





我正在添加业务逻辑层和WEB PROJECT的引用。在localhost系统中它的工作正常。在live in开发应用程序时会导致错误。我收到以下错误。





类型或命名空间名称'Infrastructure'不会存在于命名空间'System.Data.Entity'中(你是否错过了程序集引用?)





请为我建议解决方案。











谢谢®rads

sandeep miriyala

解决方案

不要通过添加引用对话框添加实体框架库(它的旧版本)你需要添加 NuGet 最新版本的软件包Entity Framework。


您需要添加 System.Data的引用项目中的.Entity.dll



- Amit


< blockquote>我已经在两个项目中添加了System.Data.Entity.dll,但它会导致错误。


Hi Code Project Team,




I have a doubt in entity framework Currently I am working in entity framework with ASP.NET Current project Infrastructure is 3 tier architecture.

1. In business logic layer I have create one method for get the records from database.
2. In ASP.NET web project using obj of above class I am calling that method in aspx.cs code behind.In aspx.cs code I am calling this reference using following name spaces

1.using System.Data.Entity;
2.using System.Data.Entity.Infrastructure;


I am adding reference both business logic layer & WEB PROJECT.In localhost system its working fine. while developing the application in live in causes error.I am getting following error.


The type or namespace name 'Infrastructure' does not exist in the namespace 'System.Data.Entity' (are you missing an assembly reference?)


Please suggested me solution for this.





Thanks &Regrads
sandeep miriyala

解决方案

Don't add Entity Framework library via "Add reference" dialog (it's old version) You need to add NuGet package "Entity Framework" of latest version.


You need to add the reference of System.Data.Entity.dll in your project.

--Amit


I am Already add the System.Data.Entity.dll in both projects but it causes error.


这篇关于实体框架ASP.NET的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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