Quantcast
Channel: ASP.NET MVC / Web API / Web Pages
Viewing all articles
Browse latest Browse all 7925

Created Issue: Math functions doesn't support System.Double in $filter [684]

$
0
0
Define model:

public class Model
{
public double Double { get; set; }
}

Send query: $filter=floor(Double) gt 5
It reports error:
System.ArgumentException occurred
HResult=-2147024809
Message=Expression of type 'System.Double' cannot be used for parameter of type 'System.Decimal' of method 'System.Decimal Floor(System.Decimal)'
Source=System.Core
StackTrace:
at System.Linq.Expressions.Expression.ValidateOneArgument(MethodBase method, ExpressionType nodeKind, Expression arg, ParameterInfo pi)
InnerException:
System.Core.dll!System.Linq.Expressions.Expression.ValidateOneArgument(System.Reflection.MethodBase method, System.Linq.Expressions.ExpressionType nodeKind, System.Linq.Expressions.Expression arg, System.Reflection.ParameterInfo pi) + 0x16b bytes
System.Core.dll!System.Linq.Expressions.Expression.ValidateArgumentTypes(System.Reflection.MethodBase method, System.Linq.Expressions.ExpressionType nodeKind, ref System.Collections.ObjectModel.ReadOnlyCollection<System.Linq.Expressions.Expression> arguments) + 0xeb bytes
System.Core.dll!System.Linq.Expressions.Expression.Call(System.Linq.Expressions.Expression instance, System.Reflection.MethodInfo method, System.Collections.Generic.IEnumerable<System.Linq.Expressions.Expression> arguments) + 0x72 bytes
> System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.MakeFunctionCall(System.Reflection.MemberInfo member, System.Linq.Expressions.Expression[] arguments) Line 621 + 0xd bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.BindFloor(Microsoft.Data.OData.Query.SingleValueFunctionCallNode node) Line 656 + 0x11 bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.BindSingleValueFunctionCallNode(Microsoft.Data.OData.Query.SingleValueFunctionCallNode node) Line 526 + 0xb bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.Bind(Microsoft.Data.OData.Query.SemanticAst.QueryNode node) Line 172 + 0x25 bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.BindBinaryOperatorNode(Microsoft.Data.OData.Query.SemanticAst.BinaryOperatorNode binaryOperatorNode) Line 270 + 0x1e bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.Bind(Microsoft.Data.OData.Query.SemanticAst.QueryNode node) Line 151 + 0x25 bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.BindBinaryOperatorNode(Microsoft.Data.OData.Query.SemanticAst.BinaryOperatorNode binaryOperatorNode) Line 271 + 0x1e bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.Bind(Microsoft.Data.OData.Query.SemanticAst.QueryNode node) Line 151 + 0x25 bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.BindFilterClause(Microsoft.Data.OData.Query.SemanticAst.FilterClause filterClause) Line 378 + 0x2a bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.Expressions.FilterBinder.Bind(Microsoft.Data.OData.Query.SemanticAst.FilterClause filterClause, System.Type filterType, Microsoft.Data.Edm.IEdmModel model, System.Web.Http.Dispatcher.IAssembliesResolver assembliesResolver, System.Web.Http.OData.Query.ODataQuerySettings querySettings) Line 110 + 0xd bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.FilterQueryOption.ApplyTo(System.Linq.IQueryable query, System.Web.Http.OData.Query.ODataQuerySettings querySettings, System.Web.Http.Dispatcher.IAssembliesResolver assembliesResolver) Line 140 + 0x4a bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.ODataQueryOptions.ApplyTo(System.Linq.IQueryable query, System.Web.Http.OData.Query.ODataQuerySettings querySettings) Line 222 + 0x27 bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.ODataQueryOptions<WebStack.QA.Test.OData.QueryComposition.ValidatorTests_Todo>.ApplyTo(System.Linq.IQueryable query, System.Web.Http.OData.Query.ODataQuerySettings querySettings) Line 52 + 0xe bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.ODataQueryOptions.ApplyTo(System.Linq.IQueryable query) Line 190 + 0x26 bytes C#
System.Web.Http.OData.dll!System.Web.Http.OData.Query.ODataQueryOptions<WebStack.QA.Test.OData.QueryComposition.ValidatorTests_Todo>.ApplyTo(System.Linq.IQueryable query) Line 40 + 0xb bytes C#
WebStack.QA.Test.OData.dll!WebStack.QA.Test.OData.QueryComposition.ValidatorTestsController.ValidateOptions(System.Web.Http.OData.Query.ODataValidationSettings settings, System.Web.Http.OData.Query.ODataQueryOptions options) Line 96 + 0x28 bytes C#


Viewing all articles
Browse latest Browse all 7925

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>