Please I need help for the below error I am getting. Whenever I query with the value that exists in the servicecontainer, it works fine. When the value does not exists, the below error surfaces:
code line that gives error:
BusinessPartner bp = currentServiceContainer.BusinessPartners.Where(
c=> c.cn==cn).SingleOrDefault();
I am using .Net core 2.2
Thanks
System.PlatformNotSupportedException
HResult=0x80131539
Message=Secure binary serialization is not supported on this platform.
Source=System.Private.CoreLib
StackTrace:
at System.Exception.add_SerializeObjectState(EventHandler`1 value)
at System.Data.Services.Client.HttpWebRequestMessage.ConvertToDataServiceWebException(WebException webException)
at System.Data.Services.Client.HttpWebRequestMessage.GetResponse()
at System.Data.Services.Client.DataServiceContext.GetResponseHelper(ODataRequestMessageWrapper request, IAsyncResult asyncResult, Boolean handleWebException)
at System.Data.Services.Client.QueryResult.ExecuteQuery()
at System.Data.Services.Client.DataServiceRequest.Execute[TElement](DataServiceContext context, QueryComponents queryComponents)
at System.Data.Services.Client.DataServiceQuery`1.GetEnumerator()
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source)
at System.Data.Services.Client.DataServiceQueryProvider.ReturnSingleton[TElement](Expression expression)
at System.Linq.Queryable.SingleOrDefault[TSource](IQueryable`1 source)
at SAPB1Servicelayer.ServiceLayerService.GetBP(String cardCode) in C:\Programs\.Net\SAPB1Servicelayer\ServiceLayerService.cs:line 1320
at SAPB1ServicelayerAPI.Services.SAPB1ServiceLayerServices.GetBusinessPartner(String cardCode) in C:\Programs\.Net\SAPB1ServicelayerAPI\SAPB1ServicelayerAPI\Services\SAPB1ServiceLayerServices.cs:line 46
at SAPB1ServicelayerAPI.Controllers.BusinessPartnersController.Get(String cardCode) in C:\Programs\.Net\SAPB1ServicelayerAPI\SAPB1ServicelayerAPI\Controllers\BusinessPartnersController.cs:line 33
at Microsoft.Extensions.Internal.ObjectMethodExecutor.Execute(Object target, Object[] parameters)
at Microsoft.AspNetCore.Mvc.Internal.ActionMethodExecutor.SyncObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
at Microsoft.AspNetCore.Mvc.Internal.ControllerActionInvoker.<InvokeActionMethodAsync>d__12.MoveNext()
User contributions licensed under CC BY-SA 3.0