“System.NotSupportedException”类型的未经处理的异常在 Microsoft.Data.Services.Client.dll 中发生

其他信息: 对此 POST 请求的响应未包含“location”标头。此客户端不支持这种做法。

未处理System.NotSupportedException
  HResult=-2146233067
  Message=对此 POST 请求的响应未包含“location”标头。此客户端不支持这种做法。
  Source=Microsoft.Data.Services.Client
  StackTrace:
       在 System.Data.Services.Client.BaseSaveResult.HandleOperationResponseHeaders(HttpStatusCode statusCode, HeaderCollection headers)
       在 System.Data.Services.Client.SaveResult.CreateNextChange()
       在 System.Data.Services.Client.DataServiceContext.SaveChanges(SaveChangesOptions options)
       在 Quick.Framework.Site.Common.OData.ODataContextClient.Add[TBizModel](TBizModel[] entities) 位置 d:\Set working folder\Quick.Framework\Quick.Framework.Site.Common\OData\ODataContextClient.cs:行号 59
       在 EbcBuy.Bll.Orders.UnitTest.OrderODataClientTest.OrderCommentsWebApiODataTest(ODataContextClient orderClient) 位置 d:\Set working folder\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.UnitTest\OrderODataClientTest.cs:行号 43
       在 EbcBuy.Bll.Orders.UnitTest.OrderODataClientTest.Test() 位置 d:\Set working folder\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.UnitTest\OrderODataClientTest.cs:行号 34
       在 EbcBuy.Bll.Orders.UnitTest.Program.Main(String[] args) 位置 d:\Set working folder\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.UnitTest\Program.cs:行号 20
       在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
       在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
       在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       在 System.Threading.ThreadHelper.ThreadStart()
  InnerException:

===================================================

"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<m:error xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n  <m:code />\r\n  <m:message xml:lang=\"en-US\">出现错误。</m:message>\r\n  <m:innererror>\r\n    <m:message>序列包含一个以上的元素</m:message>\r\n    <m:type>System.InvalidOperationException</m:type>\r\n    <m:stacktrace>   在 System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source) \n   在 System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.&lt;GetElementFunction&gt;b__2[TResult](IEnumerable`1 sequence) \n   在 System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.ExecuteSingle[TResult](IEnumerable`1 query, Expression queryRoot) \n   在 System.Data.Entity.Core.Objects.ELinq.ObjectQueryProvider.System.Linq.IQueryProvider.Execute[TResult](Expression expression) \n   在 System.Data.Entity.Internal.Linq.DbQueryProvider.Execute[TResult](Expression expression) \n   在 System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source, Expression`1 predicate) \n   在 System.Data.Entity.Migrations.DbSetMigrationsExtensions.AddOrUpdate[TEntity](DbSet`1 set, IEnumerable`1 identifyingProperties, InternalSet`1 internalSet, TEntity[] entities) \n   在 System.Data.Entity.Migrations.DbSetMigrationsExtensions.AddOrUpdate[TEntity](IDbSet`1 set, Expression`1 identifierExpression, TEntity[] entities) \n   在 EbcBuy.Dal.Users.Data.Migrations.Configuration.Seed(EFDbContextUsers context) \n   在 System.Data.Entity.Migrations.DbMigrationsConfiguration`1.OnSeed(DbContext context) \n   在 System.Data.Entity.Migrations.DbMigrator.SeedDatabase() \n   在 System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable`1 pendingMigrations, String targetMigrationId, String lastMigrationId) \n   在 System.Data.Entity.Migrations.DbMigrator.UpdateInternal(String targetMigration) \n   在 System.Data.Entity.Migrations.DbMigrator.&lt;&gt;c__DisplayClassc.&lt;Update&gt;b__b() \n   在 System.Data.Entity.Migrations.DbMigrator.EnsureDatabaseExists(Action mustSucceedToKeepDatabase) \n   在 System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) \n   在 System.Data.Entity.MigrateDatabaseToLatestVersion`2.InitializeDatabase(TContext context) \n   在 System.Data.Entity.Internal.InternalContext.&lt;&gt;c__DisplayClassf`1.&lt;CreateInitializationAction&gt;b__e() \n   在 System.Data.Entity.Internal.InternalContext.PerformInitializationAction(Action action) \n   在 System.Data.Entity.Internal.InternalContext.PerformDatabaseInitialization() \n   在 System.Data.Entity.Internal.LazyInternalContext.&lt;InitializeDatabase&gt;b__4(InternalContext c) \n   在 System.Data.Entity.Internal.RetryAction`1.PerformAction(TInput input) \n   在 System.Data.Entity.Internal.LazyInternalContext.InitializeDatabaseAction(Action`1 action) \n   在 System.Data.Entity.Internal.LazyInternalContext.InitializeDatabase() \n   在 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType) \n   在 System.Data.Entity.Internal.Linq.InternalSet`1.Initialize() \n   在 System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext() \n   在 System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider() \n   在 System.Linq.Queryable.Select[TSource,TResult](IQueryable`1 source, Expression`1 selector) \n   在 EbcBuy.Bll.Users.Services.Impl.CustomersInfoService.GetQueryOfSingleRecord() \n   在 EbcBuy.Bll.Users.Services.Impl.CustomersInfoService.GetCustomerById(Int64 ownerId, Int64 customerId) \n   在 EbcBuy.Bll.Users.Services.Impl.CustomersInfoService.Add(CustomersInfo entity) \n   在 EbcBuy.Bll.Users.WebApi.Controllers.CustomersInfoController.&lt;&gt;c__DisplayClass8.&lt;Post&gt;b__7() 位置 d:\\Set working folder\\EbcBuy.Bll\\EbcBuy.Bll.Users\\EbcBuy.Bll.Users.WebApi\\Controllers\\CustomersInfoController.cs:行号 75 \n   在 System.Threading.Tasks.Task`1.InnerInvoke() \n   在 System.Threading.Tasks.Task.Execute() \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult() \n   在 EbcBuy.Bll.Users.WebApi.Controllers.CustomersInfoController.&lt;Post&gt;d__a.MoveNext() 位置 d:\\Set working folder\\EbcBuy.Bll\\EbcBuy.Bll.Users\\EbcBuy.Bll.Users.WebApi\\Controllers\\CustomersInfoController.cs:行号 73 \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Threading.Tasks.TaskHelpersExtensions.&lt;CastToObject&gt;d__3`1.MoveNext() \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.Controllers.ApiControllerActionInvoker.&lt;InvokeActionAsyncCore&gt;d__0.MoveNext() \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.Controllers.ActionFilterResult.&lt;ExecuteAsync&gt;d__2.MoveNext() \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.Dispatcher.HttpControllerDispatcher.&lt;SendAsync&gt;d__1.MoveNext()</m:stacktrace>\r\n  </m:innererror>\r\n</m:error>"

============================================================

“System.InvalidOperationException”类型的未经处理的异常在 EntityFramework.dll 中发生

其他信息: 实体类型 ProductComments 不是当前上下文的模型的一部分。
【解决办法】在Dal层相应的Data项目里,添加Map类(数据表与PO的映射),ProductCommentsMapping
========================================================

"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<m:error xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n  <m:code />\r\n  <m:message xml:lang=\"en-US\">请求无效。</m:message>\r\n  <m:innererror>\r\n    <m:message>对于“EbcBuy.Bll.Orders.WebApi.Controllers.ComplaintController”中方法“System.Threading.Tasks.Task`1[System.Web.Http.IHttpActionResult] Patch(Int64, System.Web.Http.OData.Delta`1[EbcBuy.Bll.Orders.Models.Complaint])”的不可以为 null 的类型“System.Int64”的参数“key”,参数字典包含一个 null 项。可选参数必须为引用类型、可以为 null 的类型或声明为可选参数。</m:message>\r\n    <m:type></m:type>\r\n    <m:stacktrace></m:stacktrace>\r\n  </m:innererror>\r\n</m:error>"
【解决办法】Patch方法key参数前加"[FromODataUri]

======================================================

【ComplaintLog实体类里有如下枚举类型的属性定义
public ComplainOperation OperationType { get; set; }
当有方法使用时,如OperationType = ComplainOperation.Apply,则在OData客户端调用时会出现如下异常】
“System.InvalidOperationException”类型的未经处理的异常在 Microsoft.Data.Services.Client.dll 中发生

其他信息: 类型“EbcBuy.Bll.Common.Enums.ComplainOperation”没有可设置的属性。
【即使不使用该属性,也会报上述异常。
但定义成可空类型的话,不使用不报异常,使用则报同样异常。】
=======================================================
<m:message xml:lang="en-US">请求无效。</m:message>

<m:innererror>

<m:message>
对于“EbcBuy.Bll.Orders.WebApi.Controllers.ComplaintController”中方法“System.Web.Http.SingleResult`1[EbcBuy.Bll.Orders.Models.Complaint] Get(Int64)”的不可以为 null 的类型“System.Int64”的参数“key”,参数字典包含一个 null 项。可选参数必须为引用类型、可以为 null 的类型或声明为可选参数。
</m:message>
【】通过ie测试ComplaintController的Get方法时,使用http://localhost:39380/odata/Complaint(281406301643290151) 这个url报错。因为主键是long型, 所以,需在id后加L标记,即url改为http://localhost:39380/odata/Complaint(281406301643290151L)
=============================================================
<m:error>
<m:code/>
<m:message xml:lang="en-US">出现错误。</m:message>

<m:innererror>

<m:message>
“ObjectContent`1”类型未能序列化内容类型“application/json; charset=utf-8”的响应正文。
</m:message>
<m:type>System.InvalidOperationException</m:type>
<m:stacktrace/>

<m:internalexception>

<m:message>
'SingleResult`1' cannot be serialized using the ODataMediaTypeFormatter.
</m:message>

<m:type>
System.Runtime.Serialization.SerializationException
</m:type>
【解决办法】在Get(key)方法上面加[Queryable]

=========================================
【执行userClient.GetEntities<ReturnOrder>().ToList();提示如下异常:】"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<m:error xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n  <m:code />\r\n  <m:message xml:lang=\"en-US\">出现错误。</m:message>\r\n  <m:innererror>\r\n    <m:message>“ObjectContent`1”类型未能序列化内容类型“application/atom+xml; charset=utf-8”的响应正文。</m:message>\r\n    <m:type>System.InvalidOperationException</m:type>\r\n    <m:stacktrace></m:stacktrace>\r\n    <m:internalexception>\r\n      <m:message>Null collections cannot be serialized.</m:message>\r\n      <m:type>System.Runtime.Serialization.SerializationException</m:type>\r\n      
<m:stacktrace>   在 System.Web.Http.OData.Formatter.Serialization.ODataCollectionSerializer.CreateODataValue(Object graph, IEdmTypeReference expectedType, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEdmTypeSerializer.CreateProperty(Object graph, IEdmTypeReference expectedType, String elementName, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateStructuralProperty(IEdmStructuralProperty structuralProperty, EntityInstanceContext entityInstanceContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateStructuralPropertyBag(IEnumerable`1 structuralProperties, EntityInstanceContext entityInstanceContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateEntry(SelectExpandNode selectExpandNode, EntityInstanceContext entityInstanceContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteEntry(Object graph, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteObjectInline(Object graph, IEdmTypeReference expectedType, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteFeed(IEnumerable enumerable, IEdmTypeReference feedType, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteObjectInline(Object graph, IEdmTypeReference expectedType, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteObject(Object graph, Type type, ODataMessageWriter messageWriter, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.ODataMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content, HttpContentHeaders contentHeaders) \n   在 System.Web.Http.OData.Formatter.ODataMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken) \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.WebHost.HttpControllerHandler.&lt;WriteBufferedResponseContentAsync&gt;d__1b.MoveNext()</m:stacktrace>\r\n    </m:internalexception>\r\n  </m:innererror>\r\n</m:error>"
【问题及解决办法】在ReturnOrder的构造器里指定如下属性初始化:
            Pictures = new List<PictureModel>();
            ////ReturnOrderType = Common.Models.ReturnOrderType.RetailOrder;
            //TheStatus = ReturnOrderStatus.AgreeReturnMoney;
            //ServiceType = ReturnServiceType.None;
            ReturnOrderLogs = new List<ReturnOrderLog>();

======================================================
【用[DataServiceEntity]声明了PictureModel,
但未在WebApiConfig.cs中指定builder.EntitySet<PictureModel>("PictureModel");
会报如下异常:】
“System.InvalidOperationException”类型的未经处理的异常在 Microsoft.Data.Services.Client.dll 中发生

其他信息: 在 {http://schemas.microsoft.com/ado/2007/08/dataservices/metadata}:properties 元素中发现“EbcBuy.Bll.Orders.Models.ReturnOrder”类型上的“Pictures”属性,并且它被声明为导航属性。ATOM 中的导航属性必须表示为 {http://www.w3.org/2005/Atom}:link 元素。

============================================
【在WebApiConfig.cs中指定了builder.EntitySet<PictureModel>("PictureModel");,
但未用[DataServiceEntity]声明了PictureModel。
会报如下异常:】
“System.InvalidOperationException”类型的未经处理的异常在 Microsoft.Data.Services.Client.dll 中发生

其他信息: 类型“EbcBuy.Bll.Orders.Models.ReturnOrder”上名为“Pictures”的属性具有种类“Structural”,但它应为“Navigation”种类。
【解决办法】用[DataServiceEntity]修饰PictureModel类

===============================================
【如果做了上述2处的设定, 则执行GetReturnOrderById调用ODataClient的GetEntity方法后,得到的Picture属性值为null;
如果同时不做上述2处的设定,则执行GetReturnOrderById调用ODataClient的GetEntity方法后,得到的Picture属性有值】

====================================================
【对于ReturnOrderLog实体,同时去掉上述2处设定,则会报如下异常:
(如果去掉Id属性,则没有异常发生,跟PictureModel一样)】
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<m:error xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n  <m:code />\r\n  <m:message xml:lang=\"en-US\">出现错误。</m:message>\r\n  <m:innererror>\r\n    <m:message>“ObjectContent`1”类型未能序列化内容类型“application/atom+xml; charset=utf-8”的响应正文。</m:message>\r\n    <m:type>System.InvalidOperationException</m:type>\r\n    <m:stacktrace></m:stacktrace>\r\n    <m:internalexception>\r\n      <m:message>No NavigationLink factory was found for the navigation property 'ReturnOrderLogs' from entity type 'EbcBuy.Bll.Orders.Models.ReturnOrder' on entity set 'ReturnOrder'. Try calling HasNavigationPropertyLink on the EntitySetConfiguration. \n参数名: navigationProperty</m:message>\r\n      <m:type>System.ArgumentException</m:type>\r\n      <m:stacktrace>   在 System.Web.Http.OData.Builder.EntitySetLinkBuilderAnnotation.BuildNavigationLink(EntityInstanceContext instanceContext, IEdmNavigationProperty navigationProperty, ODataMetadataLevel metadataLevel) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateNavigationLink(IEdmNavigationProperty navigationProperty, EntityInstanceContext entityInstanceContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.&lt;CreateNavigationLinks&gt;d__1.MoveNext() \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteNavigationLinks(IEnumerable`1 navigationProperties, EntityInstanceContext entityInstanceContext, ODataWriter writer) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteEntry(Object graph, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteObjectInline(Object graph, IEdmTypeReference expectedType, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteObject(Object graph, Type type, ODataMessageWriter messageWriter, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.ODataMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content, HttpContentHeaders contentHeaders) \n   在 System.Web.Http.OData.Formatter.ODataMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken) \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.WebHost.HttpControllerHandler.&lt;WriteBufferedResponseContentAsync&gt;d__1b.MoveNext()</m:stacktrace>\r\n    </m:internalexception>\r\n  </m:innererror>\r\n</m:error>"

============================================================

【】在WebApiConfig.cs中,如果加了builder.EntitySet<ContactInfoModel>("ContactInfoModel");则通过ie访问的结果是:
{
  "odata.metadata":"http://localhost:39380/odata/$metadata#ReturnOrder/@Element","ReturnOrderId":"1406271033590870","ReturnOrderType":0,"Product":{
    "ProductId":"123","ProductName":"\u7fe0\u8d1d\u5361\u4e0a\u8863","MainPic":"this is a url here.","SkuId":123111,"SkuName":"\u9ad8\u8c03\u7ea2"
  },"OrderId":"123","ServiceType":1,"FreightPayType":1,"AskQuantity":1,"ReturnMoney":"1120.00","ProblemDisc":"model.ProblemDisc","CustomerId":"111","CustomerName":"\u6d4b\u8bd5CustomerName","ShopId":"111","ShopName":"\u6d4b\u8bd5ShopName","TheStatus":1
}

【否则是】:
{
  "odata.metadata":"http://localhost:39380/odata/$metadata#ReturnOrder/@Element","ReturnOrderId":"1406271033590870","ReturnOrderType":0,"Product":{
    "ProductId":"123","ProductName":"\u7fe0\u8d1d\u5361\u4e0a\u8863","MainPic":"this is a url here.","SkuId":123111,"SkuName":"\u9ad8\u8c03\u7ea2"
  },"OrderId":"123","ServiceType":1,"FreightPayType":1,"AskQuantity":1,"ReturnMoney":"1120.00","ProblemDisc":"model.ProblemDisc","CustomerId":"111","CustomerName":"\u6d4b\u8bd5CustomerName","CustomerContactInfo":{
    "ProvinceId":0,"ProvinceName":"Hebei","CityId":0,"CityName":"Tangshan","CountyId":0,"CountyName":"Fengrun","Address":"\u5317\u4eac\u897f\u5b89\u9633\u4e1c18:0921:5303:44\u5f53\u65e5\u5230\u8fbe","ZipCode":"100100","LinkMan":"\u6bd4\u5c14\u76d6\u8328","Telephone":null,"MobilePhone":"18233334444","EMail":null
  },"ShopId":"111","ShopName":"\u6d4b\u8bd5ShopName","ShopContactInfo":{
    "ProvinceId":0,"ProvinceName":"Hebei","CityId":0,"CityName":"Tangshan","CountyId":0,"CountyName":"Fengrun","Address":"\u5317\u4eac\u897f\u5b89\u9633\u4e1c18:0921:5303:44\u5f53\u65e5\u5230\u8fbe","ZipCode":"100100","LinkMan":"\u6bd4\u5c14\u76d6\u8328","Telephone":null,"MobilePhone":"18233334444","EMail":null
  },"TheStatus":1
}

=================================================

"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<m:error xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n  <m:code />\r\n  <m:message xml:lang=\"en-US\">出现错误。</m:message>\r\n  <m:innererror>\r\n    <m:message>“ObjectContent`1”类型未能序列化内容类型“application/atom+xml; charset=utf-8”的响应正文。</m:message>\r\n    <m:type>System.InvalidOperationException</m:type>\r\n    <m:stacktrace></m:stacktrace>\r\n    <m:internalexception>\r\n      <m:message>No NavigationLink factory was found for the navigation property 'ReturnOrderLogs' from entity type 'EbcBuy.Bll.Orders.Models.ReturnOrder' on entity set 'ReturnOrder'. Try calling HasNavigationPropertyLink on the EntitySetConfiguration. \n参数名: navigationProperty</m:message>

============================================
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<m:error xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n  <m:code />\r\n  <m:message xml:lang=\"en-US\">出现错误。</m:message>\r\n  <m:innererror>\r\n    <m:message>执行命令定义时出错。有关详细信息,请参阅内部异常。</m:message>\r\n    <m:type>System.Data.Entity.Core.EntityCommandExecutionException</m:type>\r\n    <m:stacktrace>   在 System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior) \n   在 System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues) \n   在 System.Data.Entity.Core.Objects.ObjectQuery`1.&lt;&gt;c__DisplayClass7.&lt;GetResults&gt;b__6() \n   在 System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess) \n   在 System.Data.Entity.Core.Objects.ObjectQuery`1.&lt;&gt;c__DisplayClass7.&lt;GetResults&gt;b__5() \n   在 System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation) \n   在 System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption) \n   在 System.Data.Entity.Core.Objects.ObjectQuery`1.&lt;System.Collections.Generic.IEnumerable&lt;T&gt;.GetEnumerator&gt;b__0() \n   在 System.Data.Entity.Internal.LazyEnumerator`1.MoveNext() \n   在 System.Web.Http.QueryableAttribute.SingleOrDefault(IQueryable queryable, HttpActionDescriptor actionDescriptor) \n   在 System.Web.Http.QueryableAttribute.ExecuteQuery(Object response, HttpRequestMessage request, HttpActionDescriptor actionDescriptor) \n   在 System.Web.Http.QueryableAttribute.OnActionExecuted(HttpActionExecutedContext actionExecutedContext) \n   在 System.Web.Http.Filters.ActionFilterAttribute.OnActionExecutedAsync(HttpActionExecutedContext actionExecutedContext, CancellationToken cancellationToken) \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.Filters.ActionFilterAttribute.&lt;CallOnActionExecutedAsync&gt;d__5.MoveNext() \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.Filters.ActionFilterAttribute.&lt;ExecuteActionFilterAsyncCore&gt;d__0.MoveNext() \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.Controllers.ActionFilterResult.&lt;ExecuteAsync&gt;d__2.MoveNext() \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.Dispatcher.HttpControllerDispatcher.&lt;SendAsync&gt;d__0.MoveNext()</m:stacktrace>\r\n    <m:internalexception>\r\n      <m:message>There is already an open DataReader associated with this Connection which must be closed first.</m:message>\r\n      <m:type>MySql.Data.MySqlClient.MySqlException</m:type>\r\n      <m:stacktrace>   在 MySql.Data.MySqlClient.ExceptionInterceptor.Throw(Exception exception) \n   在 MySql.Data.MySqlClient.MySqlConnection.Throw(Exception ex) \n   在 MySql.Data.MySqlClient.MySqlCommand.CheckState() \n   在 MySql.Data.MySqlClient.MySqlCommand.ExecuteReader(CommandBehavior behavior) \n   在 MySql.Data.Entity.EFMySqlCommand.ExecuteDbDataReader(CommandBehavior behavior) \n   在 System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) \n   在 System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.&lt;Reader&gt;b__c(DbCommand t, DbCommandInterceptionContext`1 c) \n   在 System.Data.Entity.Infrastructure.Interception.InternalDispatcher`1.Dispatch[TTarget,TInterceptionContext,TResult](TTarget target, Func`3 operation, TInterceptionContext interceptionContext, Action`3 executing, Action`3 executed) \n   在 System.Data.Entity.Infrastructure.Interception.DbCommandDispatcher.Reader(DbCommand command, DbCommandInterceptionContext interceptionContext) \n   在 System.Data.Entity.Internal.InterceptableDbCommand.ExecuteDbDataReader(CommandBehavior behavior) \n   在 System.Data.Common.DbCommand.ExecuteReader(CommandBehavior behavior) \n   在 System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)</m:stacktrace>\r\n    </m:internalexception>\r\n  </m:innererror>\r\n</m:error>"

============================================
<m:message>
The type 'EbcBuy.Bll.Orders.Models.ContactInfoModel' appears in two structurally incompatible initializations within a single LINQ to Entities query. A type can be initialized in two places in the same query, but only if the same properties are set in both places and those properties are set in the same order.
</m:message>
【问题&解决方法】我在GetReturnOrderById方法里同时给CustomerContactInfo和ShopContactInfo赋值,二者是ContactInfoModel类型。 如上提示,要求二者赋值的顺序一样,并且罗列相同的属性。 改为如下
CustomerContactInfo = new ContactInfoModel
{
    ProvinceName = a.CustomerArea.ProvinceName,
    CityName = a.CustomerArea.CityName,
    CountyName = a.CustomerArea.DistrictName,
    Address = a.CustomerAddress,
    LinkMan = a.CustomerLinkMan,
    ZipCode = a.CustomerZipCode,
    MobilePhone = a.CustomerPhone
},
...
ShopContactInfo = new ContactInfoModel
{
    ProvinceName = a.ShopArea.ProvinceName,
    CityName = a.ShopArea.CityName,
    CountyName = a.ShopArea.DistrictName,
    Address = a.ShopAddress,
    LinkMan = a.ShopLinkMan,
    ZipCode = a.ShopZipCode,
    MobilePhone = a.ShopPhone,
    //Telephone = a.ShopTel      【注释掉】
},
===============================================
"<!DOCTYPE html>\r\n<html>\r\n    <head>\r\n        <title>分析器错误</title>\r\n        <meta name=\"viewport\" content=\"width=device-width\" />\r\n        <style>\r\n         body {font-family:\"Verdana\";font-weight:normal;font-size: .7em;color:black;} \r\n         p {font-family:\"Verdana\";font-weight:normal;color:black;margin-top: -5px}\r\n         b {font-family:\"Verdana\";font-weight:bold;color:black;margin-top: -5px}\r\n         H1 { font-family:\"Verdana\";font-weight:normal;font-size:18pt;color:red }\r\n         H2 { font-family:\"Verdana\";font-weight:normal;font-size:14pt;color:maroon }\r\n         pre {font-family:\"Consolas\",\"Lucida Console\",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}\r\n         .marker {font-weight: bold; color: black;text-decoration: none;}\r\n         .version {color: gray;}\r\n         .error {margin-bottom: 10px;}\r\n         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }\r\n         @media screen and (max-width: 639px) {\r\n          pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }\r\n         }\r\n         @media screen and (max-width: 479px) {\r\n          pre { width: 280px; }\r\n         }\r\n        </style>\r\n    </head>\r\n\r\n    <body bgcolor=\"white\">\r\n\r\n            <span><H1>“/”应用程序中的服务器错误。<hr width=100% size=1 color=silver></H1>\r\n\r\n            <h2> <i>分析器错误</i> </h2></span>\r\n\r\n            <font face=\"Arial, Helvetica, Geneva, SunSans-Regular, sans-serif \">\r\n\r\n            <b> 说明: </b>在分析向此请求提供服务所需资源时出错。请检查下列特定分析错误详细信息并适当地修改源文件。\r\n            <br><br>\r\n\r\n            <b> 分析器错误消息: </b>未能加载类型“EbcBuy.Bll.Order.WebApi.WebApiApplication”。<br><br>\r\n\r\n            <b>源错误:</b> <br><br>\r\n\r\n            <table width=100% bgcolor=\"#ffffcc\">\r\n               <tr>\r\n                  <td>\r\n                      <code><pre>\r\n\r\n<font color=red>行 1:  &lt;%@ Application Codebehind=&quot;Global.asax.cs&quot; Inherits=&quot;EbcBuy.Bll.Order.WebApi.WebApiApplication&quot; Language=&quot;C#&quot; %&gt;\r\n</font></pre></code>\r\n\r\n                  </td>\r\n               </tr>\r\n            </table>\r\n\r\n            <br>\r\n\r\n            <b> 源文件: </b> /global.asax<b> &nbsp;&nbsp; 行: </b> 1\r\n            <br><br>\r\n\r\n            <hr width=100% size=1 color=silver>\r\n\r\n            <b>版本信息:</b>&nbsp;Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.18446\r\n\r\n            </font>\r\n\r\n    </body>\r\n</html>\r\n<!-- \r\n[HttpException]: 未能加载类型“EbcBuy.Bll.Order.WebApi.WebApiApplication”。\r\n   在 System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError)\r\n   在 System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly)\r\n   在 System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData)\r\n[HttpParseException]: 未能加载类型“EbcBuy.Bll.Order.WebApi.WebApiApplication”。\r\n   在 System.Web.UI.TemplateParser.ProcessException(Exception ex)\r\n   在 System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding)\r\n   在 System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)\r\n[HttpParseException]: 未能加载类型“EbcBuy.Bll.Order.WebApi.WebApiApplication”。\r\n   在 System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding)\r\n   在 System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath)\r\n   在 System.Web.UI.TemplateParser.ParseInternal()\r\n   在 System.Web.UI.TemplateParser.Parse()\r\n   在 System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()\r\n   在 System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider)\r\n   在 System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()\r\n   在 System.Web.Compilation.BuildProvidersCompiler.PerformBuild()\r\n   在 System.Web.Compilation.ApplicationBuildProvider.GetGlobalAsaxBuildResult(Boolean isPrecompiledApp)\r\n   在 System.Web.Compilation.BuildManager.CompileGlobalAsax()\r\n   在 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()\r\n[HttpException]: 未能加载类型“EbcBuy.Bll.Order.WebApi.WebApiApplication”。\r\n   在 System.Web.Compilation.BuildManager.ReportTopLevelCompilationException()\r\n   在 System.Web.Compilation.BuildManager.EnsureTopLevelFilesCompiled()\r\n   在 System.Web.Compilation.BuildManager.CallAppInitializeMethod()\r\n   在 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)\r\n[HttpException]: 未能加载类型“EbcBuy.Bll.Order.WebApi.WebApiApplication”。\r\n   在 System.Web.HttpRuntime.FirstRequestInit(HttpContext context)\r\n   在 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)\r\n   在 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)\r\n-->"

=============================================
"<?xml version=\"1.0\" encoding=\"utf-8\"?>\r\n<m:error xmlns:m=\"http://schemas.microsoft.com/ado/2007/08/dataservices/metadata\">\r\n  <m:code />\r\n  <m:message xml:lang=\"en-US\">出现错误。</m:message>\r\n  <m:innererror>\r\n    <m:message>“ObjectContent`1”类型未能序列化内容类型“application/atom+xml; charset=utf-8”的响应正文。</m:message>\r\n    <m:type>System.InvalidOperationException</m:type>\r\n    <m:stacktrace></m:stacktrace>\r\n    <m:internalexception>\r\n      <m:message>No NavigationLink factory was found for the navigation property 'ReturnOrderLogs' from entity type 'EbcBuy.Bll.Orders.Models.ReturnOrder' on entity set 'ReturnOrder'. Try calling HasNavigationPropertyLink on the EntitySetConfiguration. \n参数名: navigationProperty</m:message>\r\n      <m:type>System.ArgumentException</m:type>\r\n      <m:stacktrace>   在 System.Web.Http.OData.Builder.EntitySetLinkBuilderAnnotation.BuildNavigationLink(EntityInstanceContext instanceContext, IEdmNavigationProperty navigationProperty, ODataMetadataLevel metadataLevel) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.CreateNavigationLink(IEdmNavigationProperty navigationProperty, EntityInstanceContext entityInstanceContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.&lt;CreateNavigationLinks&gt;d__1.MoveNext() \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteNavigationLinks(IEnumerable`1 navigationProperties, EntityInstanceContext entityInstanceContext, ODataWriter writer) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteEntry(Object graph, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataEntityTypeSerializer.WriteObjectInline(Object graph, IEdmTypeReference expectedType, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteFeed(IEnumerable enumerable, IEdmTypeReference feedType, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteObjectInline(Object graph, IEdmTypeReference expectedType, ODataWriter writer, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.Serialization.ODataFeedSerializer.WriteObject(Object graph, Type type, ODataMessageWriter messageWriter, ODataSerializerContext writeContext) \n   在 System.Web.Http.OData.Formatter.ODataMediaTypeFormatter.WriteToStream(Type type, Object value, Stream writeStream, HttpContent content, HttpContentHeaders contentHeaders) \n   在 System.Web.Http.OData.Formatter.ODataMediaTypeFormatter.WriteToStreamAsync(Type type, Object value, Stream writeStream, HttpContent content, TransportContext transportContext, CancellationToken cancellationToken) \n--- 引发异常的上一位置中堆栈跟踪的末尾 --- \n   在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task) \n   在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) \n   在 System.Web.Http.WebHost.HttpControllerHandler.&lt;WriteBufferedResponseContentAsync&gt;d__1b.MoveNext()</m:stacktrace>\r\n    </m:internalexception>\r\n  </m:innererror>\r\n</m:error>"
===========================================================

类型“EbcBuy.Bll.Common.Models.ReturnServiceType”没有可设置的属性。

在 System.Data.Services.Client.ClientEdmModel.GetOrCreateEdmType(Type type)
   在 System.Data.Services.Client.Materialization.StructuralValueMaterializationPolicy.ApplyDataValue(ClientTypeAnnotation type, ODataProperty property, Object instance)
   在 System.Data.Services.Client.Materialization.EntryValueMaterializationPolicy.MaterializeResolvedEntry(MaterializerEntry entry, Boolean includeLinks)
   在 System.Data.Services.Client.Materialization.EntryValueMaterializationPolicy.Materialize(MaterializerEntry entry, Type expectedEntryType, Boolean includeLinks)
   在 System.Data.Services.Client.Materialization.ODataEntityMaterializer.DirectMaterializePlan(ODataEntityMaterializer materializer, MaterializerEntry entry, Type expectedEntryType)
   在 System.Data.Services.Client.Materialization.ODataEntityMaterializerInvoker.DirectMaterializePlan(Object materializer, Object entry, Type expectedEntryType)
   在 System.Data.Services.Client.ProjectionPlan.Run(ODataEntityMaterializer materializer, ODataEntry entry, Type expectedType)
   在 System.Data.Services.Client.Materialization.ODataEntityMaterializer.ReadImplementation()
   在 System.Data.Services.Client.Materialization.ODataMaterializer.Read()
   在 System.Data.Services.Client.MaterializeAtom.MoveNextInternal()
   在 System.Data.Services.Client.MaterializeAtom.MoveNext()
   在 System.Linq.Enumerable.<CastIterator>d__b1`1.MoveNext()
   在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   在 EbcBuy.Bll.Users.Test.OrderODataClientTest.Test() 位置 d:\Project_v3\EbcBuy.Bll\EbcBuy.Bll.Users\EbcBuy.Bll.Users.Test\OrderODataClientTest.cs:行号 17
   在 EbcBuy.Bll.Users.Test.Program.Main(String[] args) 位置 d:\Project_v3\EbcBuy.Bll\EbcBuy.Bll.Users\EbcBuy.Bll.Users.Test\Program.cs:行号 21
   在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Threading.ThreadHelper.ThreadStart()

=========================================================
The entity type ReturnOrder is not part of the model for the current context.

在 System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappingsForType(Type entityType)
   在 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   在 System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   在 System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   在 System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   在 System.Linq.Queryable.Select[TSource,TResult](IQueryable`1 source, Expression`1 selector)
   在 EbcBuy.Bll.Orders.Services.Impl.ReturnOrderService.GetReturnOrderList() 位置 d:\Project_v3\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.Services\Impl\ReturnOrderService.cs:行号 41
   在 EbcBuy.Bll.Orders.WebApi.Controllers.ReturnOrderController.Get() 位置 d:\Project_v3\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Order.WebApi\Controllers\ReturnOrderController.cs:行号 43
   在 lambda_method(Closure , Object , Object[] )
   在 System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
   在 System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
   在 System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
=================================================================
{"客户端和服务之间的类型不匹配。类型“EbcBuy.Bll.Orders.Models.ReturnOrder”不是实体类型,但是响应负载中的类型表示实体类型。请确保在客户端上定义的类型与服务的数据模型匹配,或更新客户端上的服务引用。"}

在 System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)
   在 System.Data.Services.Client.DataServiceQuery`1.Execute()
   在 System.Data.Services.Client.DataServiceQuery`1.GetEnumerator()
   在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   在 EbcBuy.Bll.Orders.UnitTest.ODataClient.Test() 位置 d:\Project_v3\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.UnitTest\ODataClient.cs:行号 17
   在 EbcBuy.Bll.Orders.UnitTest.Program.Main(String[] args) 位置 d:\Project_v3\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.UnitTest\Program.cs:行号 18
   在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Threading.ThreadHelper.ThreadStart()

=======================================================
{"未能加载文件或程序集“Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)":"Microsoft.Data.Edm, Version=5.6.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"}

在 System.Reflection.RuntimeModule.GetTypes(RuntimeModule module)
   在 System.Reflection.RuntimeModule.GetTypes()
   在 System.Reflection.Assembly.GetTypes()
   在 System.ComponentModel.Composition.Hosting.AssemblyCatalog.get_InnerCatalog()
   在 System.ComponentModel.Composition.Hosting.AssemblyCatalog.GetExports(ImportDefinition definition)
   在 System.ComponentModel.Composition.Hosting.DirectoryCatalog.<>c__DisplayClass3.<GetExports>b__2(ComposablePartCatalog catalog)
   在 System.Linq.Enumerable.<SelectManyIterator>d__14`2.MoveNext()
   在 System.ComponentModel.Composition.Hosting.CatalogExportProvider.InternalGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.CatalogExportProvider.InnerCatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.CatalogExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.AggregateExportProvider.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.CompositionContainer.GetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.TryGetExportsCore(ImportDefinition definition, AtomicComposition atomicComposition, IEnumerable`1& exports)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExports(ImportDefinition definition, AtomicComposition atomicComposition)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExportsCore(Type type, Type metadataViewType, String contractName, ImportCardinality cardinality)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValuesCore[T](String contractName)
   在 System.ComponentModel.Composition.Hosting.ExportProvider.GetExportedValues[T](String contractName)
   在 EbcBuy.Dal.Orders.Data.Initialize.EFDbContextOrders.get_EntityMappers() 位置 d:\Project_v3\EbcBuy.Dal\EbcBuy.Dal.Orders\EbcBuy.Dal.Orders.Data\Initialize\EFDbContextOrders.cs:行号 36
   在 Quick.Framework.Data.EFDbContext.OnModelCreating(DbModelBuilder modelBuilder) 位置 d:\Project_v3\Quick.Framework\Quick.Framework.Data\EFDbContext.cs:行号 26
   在 System.Data.Entity.DbContext.CallOnModelCreating(DbModelBuilder modelBuilder)
   在 System.Data.Entity.Internal.LazyInternalContext.CreateModelBuilder()
   在 System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
   在 System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
==========================================================
"{\"Message\":\"未找到与请求 URI“http://localhost:39380/api/ReturnOrder()/$count”匹配的 HTTP 资源。\",\"MessageDetail\":\"未找到与名为“ReturnOrder()”的控制器匹配的类型。\"}"

====================================================
"<!DOCTYPE html>\r\n<html>\r\n    <head>\r\n        <title>未能加载文件或程序集“Microsoft.Data.Services.Client”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)</title>\r\n        <meta name=\"viewport\" content=\"width=device-width\" />\r\n        <style>\r\n         body {font-family:\"Verdana\";font-weight:normal;font-size: .7em;color:black;} \r\n         p {font-family:\"Verdana\";font-weight:normal;color:black;margin-top: -5px}\r\n         b {font-family:\"Verdana\";font-weight:bold;color:black;margin-top: -5px}\r\n         H1 { font-family:\"Verdana\";font-weight:normal;font-size:18pt;color:red }\r\n         H2 { font-family:\"Verdana\";font-weight:normal;font-size:14pt;color:maroon }\r\n         pre {font-family:\"Consolas\",\"Lucida Console\",Monospace;font-size:11pt;margin:0;padding:0.5em;line-height:14pt}\r\n         .marker {font-weight: bold; color: black;text-decoration: none;}\r\n         .version {color: gray;}\r\n         .error {margin-bottom: 10px;}\r\n         .expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }\r\n         @media screen and (max-width: 639px) {\r\n          pre { width: 440px; overflow: auto; white-space: pre-wrap; word-wrap: break-word; }\r\n         }\r\n         @media screen and (max-width: 479px) {\r\n          pre { width: 280px; }\r\n         }\r\n        </style>\r\n    </head>\r\n\r\n    <body bgcolor=\"white\">\r\n\r\n            <span><H1>“/”应用程序中的服务器错误。<hr width=100% size=1 color=silver></H1>\r\n\r\n            <h2> <i>未能加载文件或程序集“Microsoft.Data.Services.Client”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)</i> </h2></span>\r\n\r\n            <font face=\"Arial, Helvetica, Geneva, SunSans-Regular, sans-serif \">\r\n\r\n            <b> 说明: </b>执行当前 Web 请求期间,出现未经处理的异常。请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息。\r\n\r\n            <br><br>\r\n\r\n            <b> 异常详细信息: </b>System.IO.FileLoadException: 未能加载文件或程序集“Microsoft.Data.Services.Client”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)<br><br>\r\n\r\n            <b>源错误:</b> <br><br>\r\n\r\n            <table width=100% bgcolor=\"#ffffcc\">\r\n               <tr>\r\n                  <td>\r\n                      <code>\r\n\r\n执行当前 Web 请求期间生成了未经处理的异常。可以使用下面的异常堆栈跟踪信息确定有关异常原因和发生位置的信息。</code>\r\n\r\n                  </td>\r\n               </tr>\r\n            </table>\r\n\r\n            <br>\r\n\r\n            <b>程序集加载跟踪:</b> 下列信息有助于确定程序集“Microsoft.Data.Services.Client”未能加载的原因。<br><br>\r\n\r\n            <table width=100% bgcolor=\"#ffffcc\">\r\n               <tr>\r\n                  <td>\r\n                      <code><pre>\r\n\r\n警告: 程序集绑定日志记录被关闭。\r\n要启用程序集绑定失败日志记录,请将注册表值 [HKLM\\Software\\Microsoft\\Fusion!EnableLog] (DWORD)设置为 1。\r\n注意: 会有一些与程序集绑定失败日志记录关联的性能损失。\r\n要关闭此功能,请移除注册表值 [HKLM\\Software\\Microsoft\\Fusion!EnableLog]。\r\n</pre></code>\r\n\r\n                  </td>\r\n               </tr>\r\n            </table>\r\n\r\n            <br>\r\n\r\n            <b>堆栈跟踪:</b> <br><br>\r\n\r\n            <table width=100% bgcolor=\"#ffffcc\">\r\n               <tr>\r\n                  <td>\r\n                      <code><pre>\r\n\r\n[FileLoadException: 未能加载文件或程序集“Microsoft.Data.Services.Client”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)]\r\n\r\n[FileLoadException: 未能加载文件或程序集“Microsoft.Data.Services.Client, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)]\r\n   System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +0\r\n   System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +34\r\n   System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks) +152\r\n   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection) +77\r\n   System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark&amp; stackMark, Boolean forIntrospection) +16\r\n   System.Reflection.Assembly.Load(String assemblyString) +28\r\n   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +38\r\n\r\n[ConfigurationErrorsException: 未能加载文件或程序集“Microsoft.Data.Services.Client, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)]\r\n   System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective) +752\r\n   System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory() +218\r\n   System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai) +130\r\n   System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig) +170\r\n   System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies() +91\r\n   System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean&amp; isRefAssemblyLoaded) +285\r\n   System.Web.Compilation.BuildManager.ExecutePreAppStart() +153\r\n   System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException) +516\r\n\r\n[HttpException (0x80004005): 未能加载文件或程序集“Microsoft.Data.Services.Client, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)]\r\n   System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9915300\r\n   System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101\r\n   System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254\r\n</pre></code>\r\n\r\n                  </td>\r\n               </tr>\r\n            </table>\r\n\r\n            <br>\r\n\r\n            <hr width=100% size=1 color=silver>\r\n\r\n            <b>版本信息:</b>&nbsp;Microsoft .NET Framework 版本:4.0.30319; ASP.NET 版本:4.0.30319.18446\r\n\r\n            </font>\r\n\r\n    </body>\r\n</html>\r\n<!-- \r\n[FileLoadException]: 未能加载文件或程序集“Microsoft.Data.Services.Client”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)\r\n[FileLoadException]: 未能加载文件或程序集“Microsoft.Data.Services.Client, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)\r\n   在 System.Reflection.RuntimeAssembly._nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)\r\n   在 System.Reflection.RuntimeAssembly.nLoad(AssemblyName fileName, String codeBase, Evidence assemblySecurity, RuntimeAssembly locationHint, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)\r\n   在 System.Reflection.RuntimeAssembly.InternalLoadAssemblyName(AssemblyName assemblyRef, Evidence assemblySecurity, RuntimeAssembly reqAssembly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean throwOnFileNotFound, Boolean forIntrospection, Boolean suppressSecurityChecks)\r\n   在 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean forIntrospection)\r\n   在 System.Reflection.RuntimeAssembly.InternalLoad(String assemblyString, Evidence assemblySecurity, StackCrawlMark& stackMark, Boolean forIntrospection)\r\n   在 System.Reflection.Assembly.Load(String assemblyString)\r\n   在 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)\r\n[ConfigurationErrorsException]: 未能加载文件或程序集“Microsoft.Data.Services.Client, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)\r\n   在 System.Web.Configuration.CompilationSection.LoadAssemblyHelper(String assemblyName, Boolean starDirective)\r\n   在 System.Web.Configuration.CompilationSection.LoadAllAssembliesFromAppDomainBinDirectory()\r\n   在 System.Web.Configuration.CompilationSection.LoadAssembly(AssemblyInfo ai)\r\n   在 System.Web.Compilation.BuildManager.GetReferencedAssemblies(CompilationSection compConfig)\r\n   在 System.Web.Compilation.BuildManager.GetPreStartInitMethodsFromReferencedAssemblies()\r\n   在 System.Web.Compilation.BuildManager.CallPreStartInitMethods(String preStartInitListPath, Boolean& isRefAssemblyLoaded)\r\n   在 System.Web.Compilation.BuildManager.ExecutePreAppStart()\r\n   在 System.Web.Hosting.HostingEnvironment.Initialize(ApplicationManager appManager, IApplicationHost appHost, IConfigMapPathFactory configMapPathFactory, HostingEnvironmentParameters hostingParameters, PolicyLevel policyLevel, Exception appDomainCreationException)\r\n[HttpException]: 未能加载文件或程序集“Microsoft.Data.Services.Client, Version=5.6.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35”或它的某一个依赖项。找到的程序集清单定义与程序集引用不匹配。 (异常来自 HRESULT:0x80131040)\r\n   在 System.Web.HttpRuntime.FirstRequestInit(HttpContext context)\r\n   在 System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context)\r\n   在 System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context)\r\n-->"
=================================================
{
  "odata.metadata":"http://localhost:39380/odata/$metadata#ProductInfo","value":[
    {
      "ProductId":"1","ProductName":"1","MarketPrice":"1.00","PurchasePrice":"1.00","HasNormalInvoice":true,"HasSpecialInvoice":true,"SupplierName":"1","Weight":1.0,"ServiceInfo":"1","OtherInfo":"1","Policy":"1","Length":0.0,"Width":0.0,"Height":0.0,"IsDeleted":false,"CreatedUserId":null,"CreatedTime":null,"ModifiedTime":null
    }
  ]
}
===========================================================
{"无法加载在应用程序配置文件中指定的 DbConfiguration 类型“MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6”。请确保使用限定程序集的名称且该程序集对运行的应用程序可用。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId=260883。"}

在 System.RuntimeTypeHandle.CreateInstance(RuntimeType type, Boolean publicOnly, Boolean noCheck, Boolean& canBeCached, RuntimeMethodHandleInternal& ctor, Boolean& bNeedSecurityCheck)
   在 System.RuntimeType.CreateInstanceSlow(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   在 System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean skipCheckThis, Boolean fillCache, StackCrawlMark& stackMark)
   在 System.Activator.CreateInstance[T]()
   在 Quick.Framework.Data.UnitOfWork`1..ctor() 位置 d:\Project_EbcBuy\Quick.Framework\Quick.Framework.Data\UnitOfWork.cs:行号 18
   在 EbcBuy.Dal.Orders.Data.Initialize.UnitContextOrders..ctor()
   在 EbcBuy.Bll.Orders.Services.Impl.ComplaintService..ctor() 位置 d:\Project_EbcBuy\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.Services\Impl\ComplaintService.cs:行号 25
   在 EbcBuy.Bll.Orders.UnitTest.ComplaintServiceUT..ctor() 位置 d:\Project_EbcBuy\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.UnitTest\ComplaintServiceUT.cs:行号 28
   在 EbcBuy.Bll.Orders.UnitTest.Program.Main(String[] args) 位置 d:\Project_EbcBuy\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.UnitTest\Program.cs:行号 25
   在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Threading.ThreadHelper.ThreadStart()

=====================
{"There is already an open DataReader associated with this Connection which must be closed first."}

在 System.Data.Entity.Core.EntityClient.Internal.EntityCommandDefinition.ExecuteStoreCommands(EntityCommand entityCommand, CommandBehavior behavior)
   在 System.Data.Entity.Core.Objects.Internal.ObjectQueryExecutionPlan.Execute[TResultType](ObjectContext context, ObjectParameterCollection parameterValues)
   在 System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__6()
   在 System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T](Func`1 func, IDbExecutionStrategy executionStrategy, Boolean startLocalTransaction, Boolean releaseConnectionOnSuccess)
   在 System.Data.Entity.Core.Objects.ObjectQuery`1.<>c__DisplayClass7.<GetResults>b__5()
   在 System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult](Func`1 operation)
   在 System.Data.Entity.Core.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   在 System.Data.Entity.Core.Objects.ObjectQuery`1.<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0()
   在 System.Data.Entity.Internal.LazyEnumerator`1.MoveNext()
   在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   在 lambda_method(Closure , OrderInfo )
   在 System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext()
   在 System.Linq.Buffer`1..ctor(IEnumerable`1 source)
   在 System.Linq.OrderedEnumerable`1.<GetEnumerator>d__0.MoveNext()
   在 System.Linq.Enumerable.<SkipIterator>d__4d`1.MoveNext()
   在 System.Linq.Enumerable.<TakeIterator>d__3a`1.MoveNext()
   在 System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   在 System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   在 EbcBuy.Bll.Orders.Services.Impl.OrderInfoService.GetOrderList(OrderQueryModel condition, Int32 pageIndex, Int32 pageSize) 位置 d:\Project_EbcBuy\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.Services\Impl\OrderInfoService.cs:行号 109
   在 EbcBuy.Bll.Orders.UnitTest.OrderInfoServiceUT.TestGetList() 位置 d:\Project_EbcBuy\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.UnitTest\OrderInfoServiceUT.cs:行号 78
   在 EbcBuy.Bll.Orders.UnitTest.Program.Main(String[] args) 位置 d:\Project_EbcBuy\EbcBuy.Bll\EbcBuy.Bll.Orders\EbcBuy.Bll.Orders.UnitTest\Program.cs:行号 25
   在 System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   在 System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   在 Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   在 System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   在 System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   在 System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   在 System.Threading.ThreadHelper.ThreadStart()

========================================================================
【访问http://localhost:39385/api/CustomersInfo提示:】

<m:message>
支持“EFDbContextUsers”上下文的模型已在数据库创建后发生更改。请考虑使用 Code First 迁移更新数据库(http://go.microsoft.com/fwlink/?LinkId=238269)。
</m:message>
<m:type>System.InvalidOperationException</m:type>

【我删掉数据库后,再刷新,发现又是下面的错误:】
<m:message>实体类型 CustomersInfo 不是当前上下文的模型的一部分。</m:message>
<m:type>System.InvalidOperationException</m:type>

在 System.Data.Entity.Internal.InternalContext.UpdateEntitySetMappingsForType(Type entityType)
   在 System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
   在 System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
   在 System.Data.Entity.Internal.Linq.InternalSet`1.get_InternalContext()
   在 System.Data.Entity.Infrastructure.DbQuery`1.System.Linq.IQueryable.get_Provider()
   在 System.Linq.Queryable.Select[TSource,TResult](IQueryable`1 source, Expression`1 selector)
   在 EbcBuy.Bll.Users.Services.Impl.CustomersInfoService.GetCustomerList() 位置 d:\Set working folder\EbcBuy.Bll\EbcBuy.Bll.Users\EbcBuy.Bll.Users.Services\Impl\CustomersInfoService.cs:行号 29
   在 EbcBuy.Bll.Users.WebApi.Controllers.CustomersInfoController.Get() 位置 d:\Set working folder\EbcBuy.Bll\EbcBuy.Bll.Users\EbcBuy.Bll.Users.WebApi\Controllers\CustomersInfoController.cs:行号 34
   在 lambda_method(Closure , Object , Object[] )
   在 System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)
   在 System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.Execute(Object instance, Object[] arguments)
   在 System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken)
【原因:】   跟EFDbContextUsers.cs里获取DirectoryCatalog的path有关。  宿主是控制台应用程序的,在..../bin/debug下, 宿主是Web的,在..../bin下。 如下代码:var catalog = new DirectoryCatalog((AppDomain.CurrentDomain.SetupInformation.PrivateBinPath)); 只适合宿主是web的。
如下代码可以兼顾以上2种情况:
                    var dir = AppDomain.CurrentDomain.BaseDirectory;
                    if (!dir.Contains("bin"))
                    {
                        dir += "\\bin";
                    }

使用OData技术遇到的问题及解决办法的更多相关文章

  1. Windows 10 技术预览版9926 “未知源”引起系统休眠后自启的解决办法

    问题的由来: 自从安装上了最新发布的Windows 10 ,使用起来有诸多的改进:无论是重绘的图标还是通知消息中心的整合还是更智能的OneDrive客户端都使得工作起来非常愉悦. 不过笔者这两天频繁遇 ...

  2. 【技术贴】解决myeclipse SVN 提交代码 commit:remains in tree-conflict错误的解决办法

    [技术贴]解决myeclipse SVN 提交代码 commit:remains in tree-conflict错误的解决办法 错误是:Aborting commit: xxxxx’ remains ...

  3. Dell R720上的系统安装问题的解决办法(关于RAID建立磁盘阵列的技术)

    摘要:本篇是本人在搭建大数量存储.搜索环境时,对于使用Dell PowerEdge R720 and R720xd作为服务器所遇到的一些问题进行的总结. 开始时,我们使用Dell提供的安装光盘(蓝色) ...

  4. js_html_input中autocomplete="off"在chrom中失效的解决办法 使用JS模拟锚点跳转 js如何获取url参数 C#模拟httpwebrequest请求_向服务器模拟cookie发送 实习期学到的技术(一) LinqPad的变量比较功能 ASP.NET EF 使用LinqPad 快速学习Linq

    js_html_input中autocomplete="off"在chrom中失效的解决办法 分享网上的2种办法: 1-可以在不需要默认填写的input框中设置 autocompl ...

  5. 【技术文档】XuebaOnline配环境时遇到的问题和解决办法

    在Ubuntu下装XuebaOnline可能遇到的问题和解决办法 自动安装Python3.0以上版本 编译命令采用python3 manage.py runserver,所以在linux系统下需要安装 ...

  6. Skype坑爹报错:“旧版本无法删除,请联络您的技术支持小组 ”的解决办法

    真是恶心的让人想吐的报错.现在终于解决了,跟大家分享一下方法. 先给问题截个图,如下 首先当我去搜解决办法之前,我已经在[控制面板]的[卸载程序]里把Skype删除了,真是让我后悔不已的操作啊!!因为 ...

  7. [大数据技术]Kettle报OPTION SQL_SELECT_LIMIT=DEFAULT错误的解决办法

    百度得到的解决方式都是说mysql通过jdbc链接的时候会进行测试’SET OPTION SQL_SELECT_LIMIT=DEFAULT’,但是5.6以后的版本弃用了set的方式. 我用的MySQL ...

  8. 懒加载session 无法打开 no session or session was closed 解决办法(完美解决)

           首先说明一下,hibernate的延迟加载特性(lazy).所谓的延迟加载就是当真正需要查询数据时才执行数据加载操作.因为hibernate当中支持实体对象,外键会与实体对象关联起来.如 ...

  9. PHPCMS后台密码忘记解决办法

    什么是PHPCMS? PHPCMS是一款网站管理软件.该软件采用模块化开发,支持多种分类方式,使用它可方便实现个性化网站的设计.开发与维护.它支持众多的程序组合,可轻松实现网站平台迁移,并可广泛满足各 ...

随机推荐

  1. 【Java学习笔记】函数的可变参数

    package p2; public class ParamterDemo { public static void main(String[] args) { int sum1 = add(4,5) ...

  2. 【Java学习笔记】集合转数组---toArray()

    package p2; import java.util.ArrayList; import java.util.Arrays; import java.util.List; public class ...

  3. Android PowerImageView实现,可以播放动画的强大ImageView

    转载请注明出处:http://blog.csdn.net/guolin_blog/article/details/11100315 我个人是比较喜欢逛贴吧的,贴吧里总是会有很多搞笑的动态图片,经常看一 ...

  4. javaweb中实现在线人数统计

    session并不是浏览器关闭时销毁的,而是在session失效的时候销毁下列代码就是监测session创建.销毁 package com.my.count; import javax.servlet ...

  5. ubuntu 安装JAVA jdk的两种方法:

    ubuntu 安装jdk 的两种方式: 1:通过ppa(源) 方式安装. 2:通过官网下载安装包安装. 这里推荐第1种,因为可以通过 apt-get upgrade 方式方便获得jdk的升级 使用pp ...

  6. “ORA-01033:ORACLE initialization or shutdown in progress”错误的解决

    网页上显示以下错误信息: ORA-:ORACLE initialization or shutdown in progress 启动oracle数据库,有以下提示信息 Database mounted ...

  7. struts2是如何加载相关的package元素节点信息的

    这不是一篇纯技术文章,而是一篇分享我个人在前后端分离路上收获的点点滴滴的文章,以此来为准备尝试前后端分离或者想了解前后端分离的童鞋做一个大体的讲解. 上一家公司是家小公司,做了一年的全栈开发,对前端的 ...

  8. 黑马程序员_Java基础:集合总结

    ------- android培训.java培训.期待与您交流! ---------- 一.集合概念 相信大家都知道,java是一门面向对象的编程语言,而对事物的体现都是以对象的形式,所以为了方便对多 ...

  9. 《python核心编程》笔记——文件的创建、读取和显示

    创建文件(makeTextFile.py)脚本提醒用户输入一个尚不存在的文件名,然后由用户输入文件每一行,最后将所有文本写入文本文件 #!/usr/bin/env python 'makeTextFi ...

  10. uva 11137 Ingenuous Cubrency

    // uva 11137 Ingenuous Cubrency // // 题目大意: // // 输入正整数n,将n写成若干个数的立方之和,有多少种 // // 解题思路: // // 注意到n只有 ...