相关疑难解决方法(0)

EF 6 System.Data.Objects.ObjectContext错误

我最近从实体框架5升级到实体框架6 Alpha 2,我收到以下错误:

找不到方法:'System.Data.Objects.ObjectContext System.Data.Entity.Infrastructure.IObjectContextAdapter.get_ObjectContext()'.

我打电话时会受到打击

if (Membership.ValidateUser(model.UserName, model.Password)) {}
Run Code Online (Sandbox Code Playgroud)

这曾经工作得很好,但不确定为什么会出现这个错误.有什么建议?

c# asp.net-mvc asp.net-mvc-4 entity-framework-6 azure-sql-database

34
推荐指数
4
解决办法
6万
查看次数

为什么我的WCF数据服务无法提供自动生成的ADO.Net EDM?

我正在尝试按照本教程:http://msdn.microsoft.com/en-us/data/gg601462.aspx 来设置ODATA服务.我使用向导从我的SQL Server数据源创建(使用向导)和ADO.NET实体数据模型.

然后我设置了一个WCF数据服务,并告诉它使用这些实体.它没有提供数据,而是产生了一个不透明的服务器错误,通过在服务器类def上面添加它,我可以减少不透明度:

[System.ServiceModel.ServiceBehavior(IncludeExceptionDetailInFaults = true)]

因此我实际上可以看到错误.从"通常java"程序员的角度来看,这看起来像是一个类转换错误.这似乎很奇怪,因为我在新安装的试用VS Pro 2013中遵循教程

有人能理解错误并告诉我如何通过这个吗?

The server encountered an error processing the request. The exception message is 'Expression of type 'System.Data.Entity.Core.Objects.ObjectContext' cannot be used for return type 'System.Data.Objects.ObjectContext''. See server logs for more details. The exception stack trace is:

at System.Linq.Expressions.Expression.ValidateLambdaArgs(Type delegateType, Expression& body, ReadOnlyCollection1 parameters) at System.Linq.Expressions.Expression.Lambda[TDelegate](Expression body, String name, Boolean tailCall, IEnumerable

1 parameters) at System.Linq.Expressions.Expression.Lambda[TDelegate](Expression body, ParameterExpression[] parameters) at System.Data.Services.Providers.DbContextHelper.CreateDbContextAccessor(Type type) at System.Data.Services.Providers.DbContextHelper.GetDbContextAccessor(Type type) at System.Data.Services.Providers.DbContextHelper.IsDbContextType(Type type) …

.net c# linq wcf odata

8
推荐指数
1
解决办法
4195
查看次数