ZEXSM / OData.QueryBuilder

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

Support no ContainerModel #48

Closed h3rmanj closed 3 years ago

h3rmanj commented 3 years ago

I'm not sure why a ContainerModel is needed for the QueryBuilder. It would be nice if you could just pass a string to .For<>():

var uri = new ODataQueryBuilder()
    .For<ODataTypeEntity>("ODataTypeEntity")
    .ByKey("223123123")
    .ToUri()

It's not the biggest hassle to create a ContainerModel though, so this would just be a nice to have.

ZEXSM commented 3 years ago

Hey! In general, I do not mind supporting this. The ContainerModel is required to type the resource name, nothing more.

ZEXSM commented 3 years ago

I think I figured out the problem. Everything I've done now is focused on the Container which is automatically generated by this https://marketplace.visualstudio.com/items?itemName=marketplace.ODataConnectedService but you are using something else, and you simply do not have it. I will try to take this into account in PR.

h3rmanj commented 3 years ago

Ah, yes, I've only used some shared models that the OData API exposes. Maybe the Usage section in the readme should contain a note about the ConnectedService generation as well?

I'll try to use it tomorrow, but I know I have tried earlier with some OData API's that the ConnectedService couldn't generate, so this would still be nice to have!