The following two pieces of code crashes with the same error message "Argument types do not match"
NOTE: The query used is "http://localhost:52473/api/myentity/bymunicipality/4fba6fd37fbbc823acdf1d36?$filter=startswith(Name,'Test') eq true"
[Queryable]
public async Task<HttpResponseMessage> GetByMunicipality(string municipalityId)
{
var result = await this.entityRepository.GetByMunicipality(municipalityId);
return Request.CreateResponse(HttpStatusCode.OK, result.AsQueryable());
}
[Queryable]
public async Task<IEnumerable<MyEntity>> GetByMunicipality(string municipalityId, ODataQueryOptions options)
{
var result = await this.entityRepository.GetByMunicipality(municipalityId);
return options.ApplyTo(result.AsQueryable());
}
While this one works:
[Queryable]
public async Task<IEnumerable<MyEntity>> GetByMunicipality(string municipalityId)
{
var result = await this.entityRepository.GetByMunicipality(municipalityId);
return result.ToList();
}
Shouldn't they all return the same thing?
NOTE: The query used is "http://localhost:52473/api/myentity/bymunicipality/4fba6fd37fbbc823acdf1d36?$filter=startswith(Name,'Test') eq true"
[Queryable]
public async Task<HttpResponseMessage> GetByMunicipality(string municipalityId)
{
var result = await this.entityRepository.GetByMunicipality(municipalityId);
return Request.CreateResponse(HttpStatusCode.OK, result.AsQueryable());
}
[Queryable]
public async Task<IEnumerable<MyEntity>> GetByMunicipality(string municipalityId, ODataQueryOptions options)
{
var result = await this.entityRepository.GetByMunicipality(municipalityId);
return options.ApplyTo(result.AsQueryable());
}
While this one works:
[Queryable]
public async Task<IEnumerable<MyEntity>> GetByMunicipality(string municipalityId)
{
var result = await this.entityRepository.GetByMunicipality(municipalityId);
return result.ToList();
}
Shouldn't they all return the same thing?