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

ODataQuery.ToDictionary() returns not all items #83

Closed Pisaren closed 2 years ago

Pisaren commented 2 years ago

In case when ODataQuery was instantiated with empty StringBuilder (without baseUrl or baseUrl equal to empty string) then reading split string from second element (index=1) skips first URL parameter.

ZEXSM commented 2 years ago

Give an example in the format expectation is reality

Pisaren commented 2 years ago

When I execute next code

var builder = new ODataQueryBuilder().For<Model>()
    .ByList()
    .Filter(x => x.LongId == 1);
var uri = builder.ToDictionary();

I get empty dictionary, but expect a dictionary with one item: key="$filter", value="LongId eq 1".

ZEXSM commented 2 years ago

Hi. The resource must always be specified