You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have attempted to convert the property using a ValueConverter but the following error is encountered:
Error: System.ArgumentException: Can not convert Array to String.
at Newtonsoft.Json.Linq.JToken.op_Explicit(JToken value)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObjectT
at lambda_method(Closure , QueryContext , JObject )
at Microsoft.EntityFrameworkCore.Cosmos.Query.Internal.CosmosShapedQueryCompilingExpressionVisitor.AsyncQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken)
at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable1 source, CancellationToken cancellationToken) at DF.ConfigManager.Features.Configuration.FulfillmentOptions.IndexMediator.QueryHandler.Handle(Query request, CancellationToken cancellationToken) in C:\dev\DF.ConfigManager\src\DF.ConfigManager\Features\Configuration\FulfillmentOptions\IndexMediator.cs:line 27 at MediatR.Pipeline.RequestPostProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)
at DF.ConfigManager.Features.Configuration.FulfillmentOptions.IndexBase.OnInitializedAsync() in C:\dev\DF.ConfigManager\src\DF.ConfigManager\Features\Configuration\FulfillmentOptions\Index.razor.cs:line 18
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
If the property is ignored, the model is returned successfully. I have another property, FulfillmentOption, which is of type enum and is setup to use the EnumToStringConverter and that is working without issue.
EF Core version: 3.0.0
Database provider: Microsoft.EntityFrameworkCore.Cosmos
Target framework: .NET Core 3.0
Operating system: Windows 10
IDE: Visual Studio 2019 16.3
The text was updated successfully, but these errors were encountered:
This issue has been closed as duplicate of #14762, but that one address primitive types like string or int but does not seem to support enum. @AndriySvyryd is it possible to reopen?
The following simple model fails to map when querying with the Azure Cosmos Db provider:
I have attempted to convert the property using a ValueConverter but the following error is encountered:
Error: System.ArgumentException: Can not convert Array to String.
at Newtonsoft.Json.Linq.JToken.op_Explicit(JToken value)
at Newtonsoft.Json.Linq.JToken.ToObject(Type objectType)
at Newtonsoft.Json.Linq.JToken.ToObjectT
at lambda_method(Closure , QueryContext , JObject )
at Microsoft.EntityFrameworkCore.Cosmos.Query.Internal.CosmosShapedQueryCompilingExpressionVisitor.AsyncQueryingEnumerable
1.AsyncEnumerator.MoveNextAsync() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable
1 source, CancellationToken cancellationToken)at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable
1 source, CancellationToken cancellationToken) at DF.ConfigManager.Features.Configuration.FulfillmentOptions.IndexMediator.QueryHandler.Handle(Query request, CancellationToken cancellationToken) in C:\dev\DF.ConfigManager\src\DF.ConfigManager\Features\Configuration\FulfillmentOptions\IndexMediator.cs:line 27 at MediatR.Pipeline.RequestPostProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate1 next) at MediatR.Pipeline.RequestPreProcessorBehavior
2.Handle(TRequest request, CancellationToken cancellationToken, RequestHandlerDelegate`1 next)at DF.ConfigManager.Features.Configuration.FulfillmentOptions.IndexBase.OnInitializedAsync() in C:\dev\DF.ConfigManager\src\DF.ConfigManager\Features\Configuration\FulfillmentOptions\Index.razor.cs:line 18
at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
If the property is ignored, the model is returned successfully. I have another property, FulfillmentOption, which is of type enum and is setup to use the EnumToStringConverter and that is working without issue.
EF Core version: 3.0.0
Database provider: Microsoft.EntityFrameworkCore.Cosmos
Target framework: .NET Core 3.0
Operating system: Windows 10
IDE: Visual Studio 2019 16.3
The text was updated successfully, but these errors were encountered: