unitycontainer / microsoft-dependency-injection

Unity.Microsoft.DependencyInjection package
Apache License 2.0
63 stars 36 forks source link

How could I use PerRequestLifetimeManager with .Net Core 3.1 #85

Closed Angus221 closed 4 years ago

Angus221 commented 4 years ago

PerRequestLifetimeManager is in unity.mvc ,but unity.mvc doesn't support NetCoreApp, how could I use PerRequestLifetimeManager with asp.net webapi core 3.1?

ENikS commented 4 years ago

You could just copy source and use it in your project

luizfbicalho commented 4 years ago

I think that it's not necessary anymore, you should use Hierarquical Lifetime Manager and add scope on each request.

ENikS commented 4 years ago

I am assuming this question is answered and closing the issue. Please let me know if I should reopen.

geetmenon commented 3 years ago

"I think that it's not necessary anymore, you should use Hierarquical Lifetime Manager and add scope on each request."

Could you provide a code sample to do this.