Create OData endpoint for Items entity defined as
public class Item
{
[Key]
public int ItemId { get; set; }
// other properties
public IDictionary DynamicProperties { get; set; }
}
Try to run query Items?$apply=aggregate(I with max as MaxId) where I is dynamic property.
It will fail with ArgumentNull exception:
at Microsoft.OData.ExceptionUtils.CheckArgumentNotNull[T](T value, String parameterName)
at Microsoft.OData.UriParser.Aggregation.AggregateExpression..ctor(SingleValueNode expression, AggregationMethod method, String alias, IEdmTypeReference typeReference)
at Microsoft.OData.UriParser.Aggregation.ApplyBinder.BindAggregateExpressionToken(AggregateExpressionToken token)
at Microsoft.OData.UriParser.Aggregation.ApplyBinder.BindAggregateToken(AggregateToken token)
at Microsoft.OData.UriParser.Aggregation.ApplyBinder.BindApply(IEnumerable`1 tokens)
at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseApplyImplementation(String apply, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo)
at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseApply()
at System.Web.OData.Query.ApplyQueryOption.get_ApplyClause()
Assemblies affected
OData .Net lib 6.15.* OData .Net lib 7.0.*
Additional details
Reason is that for SingleValueOpenPropertyAccessNode TypeReference is null, but AggregateExpression expects not null
Create OData endpoint for Items entity defined as
Try to run query Items?$apply=aggregate(I with max as MaxId) where I is dynamic property.
It will fail with ArgumentNull exception:
at Microsoft.OData.ExceptionUtils.CheckArgumentNotNull[T](T value, String parameterName)
at Microsoft.OData.UriParser.Aggregation.AggregateExpression..ctor(SingleValueNode expression, AggregationMethod method, String alias, IEdmTypeReference typeReference)
at Microsoft.OData.UriParser.Aggregation.ApplyBinder.BindAggregateExpressionToken(AggregateExpressionToken token)
at Microsoft.OData.UriParser.Aggregation.ApplyBinder.BindAggregateToken(AggregateToken token)
at Microsoft.OData.UriParser.Aggregation.ApplyBinder.BindApply(IEnumerable`1 tokens)
at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseApplyImplementation(String apply, ODataUriParserConfiguration configuration, ODataPathInfo odataPathInfo)
at Microsoft.OData.UriParser.ODataQueryOptionParser.ParseApply()
at System.Web.OData.Query.ApplyQueryOption.get_ApplyClause()
Assemblies affected
OData .Net lib 6.15.* OData .Net lib 7.0.*
Additional details
Reason is that for SingleValueOpenPropertyAccessNode TypeReference is null, but AggregateExpression expects not null