Unable to create a constant value of type ‘Microsoft.OData.Edm.IEdmModel’ for OData Select Request
I’m using OData 8.2.5 with .NET 6 and I’m trying to return results from my controller shown below. When I hit /odata/MyType it works, but if I hit /odata/MyType?$select=Id, I get the error in the title, System.NotSupportedException: Unable to create a constant value of type ‘Microsoft.OData.Edm.IEdmModel’. If I return a List and call ToList() on my set then the select works, but I can’t afford to load everything into memory before the select filters are applied. I want to make it work with IQueryable. Any help is appreciated!
System.NotSupportedException: Unable to create a constant value of type ‘Microsoft.OData.Edm.IEdmModel’
I’m using OData 8.2.5 with .NET 6 and I’m trying to return results from my controller shown below. When I hit /odata/MyType it works, but if I hit /odata/MyType?$select=Id, I get the error in the title, System.NotSupportedException: Unable to create a constant value of type ‘Microsoft.OData.Edm.IEdmModel’. If I return a List and call ToList() on my set then the select works, but I can’t afford to load everything into memory before the select filters are applied. I want to make it work with IQueryable. Any help is appreciated!