Die Anwendung deutlich zu OData query

Möchte ich, um eine Liste von unterschiedlichen Werten aus meiner OData-Endpunkt. Aber distinct-oder group by wird jedoch nicht unterstützt.

Mein URI-query sieht wie folgt

GET /odata/Products?$select=foo & $top=10 & $count=true & distinct=true

Mein Controller

[EnableQuery]
public IQueryable<FooBarBaz> Get(ODataQueryOptions<FooBarBaz> queryOptions, bool distinct)
{
        //I've tried the following
        return Repository.AsQueryable().Distinct();

        //and
        return Repository.AsQueryable().GroupBy(x => x.Foo);

        //and
        IQueryable query = queryOptions.ApplyTo(Repository.AsQueryable());
        return query.Distinct(); //Can't call .Distinct() here
}

Keine funktioniert 🙁

Die Komponente AdaptiveLINQ kann Ihnen helfen. Disclaimer: ich bin der AdaptiveLINQ Entwickler.
Ich werde mal schauen 🙂

InformationsquelleAutor Snæbjørn | 2015-05-08

Schreibe einen Kommentar