Understanding in advance the reservation that "just because the opportunity offered does not make it a good idea" ...
In appearance, OData-compatible Signatures require IQueryable to return .
FOR EXAMPLE:
[Queryable] public IQueryable<MyModel> Get() { return _repo.GetAll().AsQueryable(); }
However, many articles in the recent and not quite recent past describe IQueryable as:
MY QUESTION :
Do you feel the capabilities of IQueryable and OData above problems?
Answering, I would expect people to talk about:
- Why or why not?
- When should you use it?
- Are you using only some of the WebAPI calls ... or for all WebAPI calls?
- What about individual models that are not IEnumarable objects?
... such things.
BACKGROUND : I ask not only because of the above elements. But also because OData is being sold to us as an โindustry standard,โ not a tool in your toolbox. Thus, implementing this will fundamentally change the return for our WebAPI calls (where I work now). We would have to go from our own IResult backlink (which is very useful) to IQueryable, which seems to have problems (but may also prove useful).
IRESULT example:
At a minimum, our reverse signatures have changed dramatically. And, as I was told, a WebAPI call that implements OData does not work, changing the "C instance" to "IQueryable Instance" (which makes sense).
public interface IResult<C> { [JsonProperty(PropertyName = "hasErrors")] bool HasErrors { get; } [JsonProperty(PropertyName = "errors")] IList<String> Errors { get; } [JsonProperty(PropertyName = "instance")] C Instance { get; set; } }
Prisoner zero
source share