OData / RESTier

A turn-key library for building RESTful services
http://odata.github.io/RESTier
Other
468 stars 136 forks source link

[2.0] Make Dependency Injection more magical #752

Open cilerler opened 7 months ago

cilerler commented 7 months ago

As a user, I want Restier to integrate with ASP.NET Core's default Dependency Injection (DI) container, so that I can streamline project setup.

robertmclaws commented 7 months ago

Given that Restier is pretty dependent on OData's .NET implementation, which requires a DI container per route, this is not likely going to be possible in the current iteration.

If I had my way, I would redesign OData AspNetCore 9.0 to use the KeyedServices in .NET 8 to keep all of the services fully-accessible in the root DI container. Then I would build Restier 2.0 on top of that.

We'll see if I can convince Microsoft to do that. Until then, we might be able to make just Restier 2.0 work that way... we'll just have to see what happens.