ZEXSM / OData.QueryBuilder

OData.QueryBuilder - library for creating complex OData queries (OData version 4.01) based on data models with linq syntax.
MIT License
71 stars 31 forks source link

StringExtensions.ToQuery() does not support some types #82

Closed Pisaren closed 2 years ago

Pisaren commented 2 years ago

For example StringExtensions.ToQuery() does not process correctly IEnumerable<long> and in that case returns "System.Int64[]" string. Also it doesn't support IEnumerable<byte>, IEnumerable<short>, IEnumerable<DateTime>.

ZEXSM commented 2 years ago

Give an example in the format expectation is reality

Pisaren commented 2 years ago

Sorry, did not check how my previous message was shown. Edited it. When I execute next code

var builder = new ODataQueryBuilder().For<Model>("model")
    .ByList()
    .Filter((x, _, o) => o.In(x.LongId, new long [] { (long)0, (long)-5 }));
var uri = builder.ToUri();

I get model?$filter=LongId in ('System.Int64[]'), but expect model?$filter=LongId in (0,-5)