System.ArgumentNullException: 缓冲区不能为 null。 #3
Description
`
IEnumerable citylives = await publishCtx.Load(publishCtx.GetCityAQIPublishLivesQuery()).ResultAsync();
Console.Write("\r\n进行下一阶段演示:"); Console.ReadLine(); Console.Clear();
AQIDataPublishLive[] sizeData = null;
//sizeData = await publishCtx.GetAirByCity(230600).ResultAsync<AQIDataPublishLive[]>().ConfigureAwait(false);
//根据城市code获取所有检测站的空气数据
//AQIDataPublishLive[] sizeData = null;
//string ab = "230600";
foreach (var c in citylives) {
//IEnumerable<AQIDataPublishLive> sitess = await publishCtx.Load(publishCtx.GetAirByCity(c.CityCode)).ResultAsync();
Console.WriteLine("CityCode:" + c.CityCode);
sizeData = await publishCtx.GetAirByCity(c.CityCode).ResultAsync<AQIDataPublishLive[]>();
}
`
执行上述foreach循环时报以下错误
CityCode:220300
CityCode:220400
CityCode:220500
CityCode:220600
CityCode:220700
CityCode:220800
CityCode:222400
CityCode:230100
CityCode:230200
CityCode:230300
CityCode:230400
CityCode:230500
CityCode:230600
未经处理的异常:
未经处理的异常: OpenRiaServices.DomainServices.Client.DomainOperationException: Invoke operation 'GetAirByCity' failed. 引发类型为“OpenRiaServices.DomainServices.Client.DomainOperationException”的异常。
在 OpenRiaServices.DomainServices.Client.OperationBase.Complete(Exception error) 位置 C:\Users\danie\GitHub\openriaservices\OpenRiaServices.DomainServices.Client\Framework\Silverlight\OperationBase.cs:行号 299
在 OpenRiaServices.DomainServices.Client.InvokeOperation.Complete(Exception error) 位置 C:\Users\danie\GitHub\openriaservices\OpenRiaServices.DomainServices.Client\Framework\Silverlight\Data\InvokeOperation.cs:行号 212
在 OpenRiaServices.DomainServices.Client.DomainContext.CompleteInvoke(IAsyncResult asyncResult) 位置 C:\Users\danie\GitHub\openriaservices\OpenRiaServices.DomainServices.Client\Framework\Silverlight\Data\DomainContext.cs:行号 1073
在 OpenRiaServices.DomainServices.Client.DomainContext.<>c__DisplayClass61_1.b__2(Object ) 位置 C:\Users\danie\GitHub\openriaservices\OpenRiaServices.DomainServices.Client\Framework\Silverlight\Data\DomainContext.cs:行号 1026
在 System.Threading.QueueUserWorkItemCallback.WaitCallback_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.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
在 System.Threading.ThreadPoolWorkQueue.Dispatch()
在 System.Threading._ThreadPoolWaitCallback.PerformWaitCallback()
System.AggregateException: 发生一个或多个错误。 ---> System.ArgumentNullException: 缓冲区不能为 null。
参数名: buffer
在 System.IO.MemoryStream..ctor(Byte[] buffer, Boolean writable)
在 System.IO.MemoryStream..ctor(Byte[] buffer)
在 Com.Hzexe.Air.OpenAirLibrary.EntityQueryExt.Decompress(Byte[] baseBytes)
在 Com.Hzexe.Air.OpenAirLibrary.EntityQueryExt.<>c__DisplayClass1_01.<ResultAsync>b__0() 在 System.Threading.Tasks.Task
1.InnerInvoke()
在 System.Threading.Tasks.Task.Execute()
--- 引发异常的上一位置中堆栈跟踪的末尾 ---
在 System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
在 System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
在 Example.Program.d__7.MoveNext() 位置 E:\test123\openair\example\Program.cs:行号 204
--- 内部异常堆栈跟踪的结尾 ---
在 System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
在 System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
在 System.Threading.Tasks.Task.Wait()
在 Example.Program.Main(String[] args) 位置 E:\test123\openair\example\Program.cs:行号 37