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
--
How do I write LINQ that gets interpreted to that?
var list = new List {"1" };
client.Filter(x => x.someprop == 2 && list.Contains(x.prop));
Throws exception:
Microsoft.OData.ODataException: The type 'System.Collections.Generic.List1[System.String]' is not supported when converting to a URI literal. at Microsoft.OData.Evaluation.LiteralFormatter.FormatRawLiteral(Object value) at Microsoft.OData.Evaluation.LiteralFormatter.FormatAndEscapeLiteral(Object value) at Microsoft.OData.Evaluation.LiteralFormatter.DefaultLiteralFormatter.FormatLiteralWithTypePrefix(Object value) at Microsoft.OData.Evaluation.LiteralFormatter.DefaultLiteralFormatter.Format(Object value) at Simple.OData.Client.V4.Adapter.CommandFormatter.ConvertValueToUriLiteral(Object value, Boolean escapeDataString) at Simple.OData.Client.ODataExpression.Format(ExpressionContext context) at System.Linq.Enumerable.SelectListIterator2.MoveNext()
at System.String.JoinCore[T](Char* separator, Int32 separatorLength, IEnumerable1 values) at Simple.OData.Client.ODataExpression.FormatMappedFunction(ExpressionContext context, FunctionMapping mapping) at Simple.OData.Client.ODataExpression.FormatFunction(ExpressionContext context) at Simple.OData.Client.ODataExpression.Format(ExpressionContext context) at Simple.OData.Client.ODataExpression.Format(ExpressionContext context) at Simple.OData.Client.FluentCommand.Resolve() at Simple.OData.Client.FluentCommand.GetCommandTextAsync(CancellationToken cancellationToken) at Simple.OData.Client.ODataClient.FindEntriesAsync(FluentCommand command, Boolean scalarResult, ODataFeedAnnotations annotations, CancellationToken cancellationToken) at Simple.OData.Client.FluentClientBase2.FilterAndTypeColumnsAsync(Task1 entries, IList1 selectedColumns, String dynamicPropertiesContainerName)
The text was updated successfully, but these errors were encountered:
This is not yet supported by the library: Contains is only implemented for string operations. I am adding this feature to a wish list, will checkout how hard it is to implement.
In the OData 4 standard there's an expression:
http://host/service/Products?$filter=Name in ('Milk', 'Cheese')
(http://docs.oasis-open.org/odata/odata/v4.01/csprd02/part2-url-conventions/odata-v4.01-csprd02-part2-url-conventions.html#sec_LogicalOperatorExamples)
--
How do I write LINQ that gets interpreted to that?
var list = new List {"1" };
client.Filter(x => x.someprop == 2 && list.Contains(x.prop));
Throws exception:
Microsoft.OData.ODataException: The type 'System.Collections.Generic.List
1[System.String]' is not supported when converting to a URI literal. at Microsoft.OData.Evaluation.LiteralFormatter.FormatRawLiteral(Object value) at Microsoft.OData.Evaluation.LiteralFormatter.FormatAndEscapeLiteral(Object value) at Microsoft.OData.Evaluation.LiteralFormatter.DefaultLiteralFormatter.FormatLiteralWithTypePrefix(Object value) at Microsoft.OData.Evaluation.LiteralFormatter.DefaultLiteralFormatter.Format(Object value) at Simple.OData.Client.V4.Adapter.CommandFormatter.ConvertValueToUriLiteral(Object value, Boolean escapeDataString) at Simple.OData.Client.ODataExpression.Format(ExpressionContext context) at System.Linq.Enumerable.SelectListIterator
2.MoveNext()at System.String.JoinCore[T](Char* separator, Int32 separatorLength, IEnumerable
1 values) at Simple.OData.Client.ODataExpression.FormatMappedFunction(ExpressionContext context, FunctionMapping mapping) at Simple.OData.Client.ODataExpression.FormatFunction(ExpressionContext context) at Simple.OData.Client.ODataExpression.Format(ExpressionContext context) at Simple.OData.Client.ODataExpression.Format(ExpressionContext context) at Simple.OData.Client.FluentCommand.Resolve() at Simple.OData.Client.FluentCommand.GetCommandTextAsync(CancellationToken cancellationToken) at Simple.OData.Client.ODataClient.FindEntriesAsync(FluentCommand command, Boolean scalarResult, ODataFeedAnnotations annotations, CancellationToken cancellationToken) at Simple.OData.Client.FluentClientBase
2.FilterAndTypeColumnsAsync(Task1 entries, IList
1 selectedColumns, String dynamicPropertiesContainerName)The text was updated successfully, but these errors were encountered: