我对与妇联有关的 st子 a一 total一.,从而激化我的神经问题,但我不敢肯定,从哪里开始在学习民主运动的基础时找出错误。
I have an existing MVC3 application using a database, using the universal membership provider (added via nuget) and a small SDF database accessed via SQL Server Compact Edition Client Data Provider 4.0. I created it with the following steps:
1) create a new library project for the data layer, add EDMX from a database, then add ADO.NET DB context and entities generators templates.
(2) 为通用数据接口设立一个新图书馆项目:一个存放接口,在(1)中实施,而有产出的t4模板从(1)转入该项目(交换TT putFile,第1段参数,以便在另一个项目中提及EDMX)。
3) create a new MVC application which uses Ninject to instantiate the generic repository declared in (2) with the SDF-based repository implemented in (1).
The web application works fine, and I can view and edit data. Now I should expose some of its functions via a WCF service and I was looking at OData for this. So I added a new WCF Data Service, and changed the generated code just to test it, by adding the name of my entities class (as implemented in (1)) and the name of an entity set, e.g.:
public class ProjectService : DataService<OrganizerEntities>
{
public static void InitializeService(DataServiceConfiguration config)
{
config.SetEntitySetAccessRule("Projects", EntitySetRights.AllRead);
config.DataServiceBehavior.MaxProtocolVersion = DataServiceProtocolVersion.V2;
}
}
当我在浏览器上打开特别安全局时,我获得
... http://msdn.microsoft.com/it-IT/library/System.ServiceModel.EvaluationContextNotFound.aspx Configuration evaluation context not found. ...
and then an ArgumentNullException exception whose details follow. In all the samples or tutorials I ve found I see the typical not-so-real-world example where the data layer is not separated from the consumer application: create a new MVC app, add an EDMX, add a WCF Data Service, change some lines of generated code, and all magically works :). So I suppose this is related to my layered architecture, especially for the missing context warning. Could anyone help in using this service in a layered scenario like this? Thanks!
... Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary
2.FindEntry(TKey key) at System.Collections.Generic.Dictionary
2.get_Item(TKey key) at System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMetadata(IDictionary2 knownTypes, IDictionary
2 childTypes, IDictionary2 entitySets) at System.Data.Services.Providers.BaseServiceProvider.PopulateMetadata() at System.Data.Services.DataService
1.CreateProvider() at System.Data.Services.DataService1.HandleRequest() at System.Data.Services.DataService
1.ProcessRequestForMessage(Stream messageBody) at SyncInvokeProcessRequestForMessage(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) System.ArgumentNullException: Value cannot be null. Parameter name: key at System.Collections.Generic.Dictionary2.FindEntry(TKey key) at System.Collections.Generic.Dictionary
2.get_Item(TKey key) at System.Data.Services.Providers.ObjectContextServiceProvider.PopulateMetadata(IDictionary2 knownTypes, IDictionary
2 childTypes, IDictionary2 entitySets) at System.Data.Services.Providers.BaseServiceProvider.PopulateMetadata() at System.Data.Services.DataService
1.CreateProvider() at System.Data.Services.DataService1.HandleRequest() at System.Data.Services.DataService
1.ProcessRequestForMessage(Stream messageBody) at SyncInvokeProcessRequestForMessage(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage41(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage4(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage3(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage2(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage11(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage1(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet) ...