ZEXSM / OData.QueryBuilder

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

Is resource parameter necessary in ODataQueryBuilder.For<TEntity>? #88

Closed wesley-sd closed 2 years ago

wesley-sd commented 2 years ago

We've updated library to latest version, and it started to throw exception on For. In our project we had: new ODataQueryBuilder().For<OurClass>("") because we don't need the resource name for our purposes, but right now we see check-throw block of code there.

Would it be possible to add?

It will be up to developer which of this For methods will be used, based on expected results.

ZEXSM commented 2 years ago

Hi! It's always there as far as I know. I would like to see an example of how you use a constructor without a resource

wesley-sd commented 2 years ago

We were using it like this: new ODataQueryBuilder().For<OurClass>("") because we don't need the resource name in Uri. It of course started to throw exception after upgrade. My proposal is to add another method without any parameters. If developer needs the resource name - will use 1 parameter method, which will throw exception as it is throwing right now. If developer doesn't need the resource name - will use parameterless method.

ZEXSM commented 2 years ago

I would also like to see an example of a request url to your odata service