diff --git a/src/Microsoft.AspNetCore.OData/Extensions/HttpContextExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/HttpContextExtensions.cs index 30503d1b..ddba2d4b 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/HttpContextExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/HttpContextExtensions.cs @@ -11,6 +11,7 @@ using System.Reflection; using System.Threading.Tasks; using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc.Routing; using Microsoft.AspNetCore.OData.Abstracts; using Microsoft.AspNetCore.OData.Edm; using Microsoft.AspNetCore.OData.Formatter; @@ -97,7 +98,8 @@ internal static bool IsMinimalEndpoint(this HttpContext httpContext) // Check if the endpoint is a minimal endpoint. var endpoint = httpContext.GetEndpoint(); - return endpoint?.Metadata.GetMetadata() != null; + return endpoint?.Metadata.GetMetadata() == null + && endpoint?.Metadata.GetMetadata() != null; } internal static IEdmModel GetOrCreateEdmModel(this HttpContext httpContext, Type clrType, ParameterInfo parameter = null) diff --git a/test/Microsoft.AspNetCore.OData.E2E.Tests/DollarSearch/DollarSearchDataModel.cs b/test/Microsoft.AspNetCore.OData.E2E.Tests/DollarSearch/DollarSearchDataModel.cs index afc9bfa9..25dc2df2 100644 --- a/test/Microsoft.AspNetCore.OData.E2E.Tests/DollarSearch/DollarSearchDataModel.cs +++ b/test/Microsoft.AspNetCore.OData.E2E.Tests/DollarSearch/DollarSearchDataModel.cs @@ -23,7 +23,7 @@ public class SearchProduct public SearchCategory Category { get; set; } - public List Tags { get; set; } // List of tags + public List Tags { get; set; } // List of tags } public class SearchCategory