You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Autofac
Hello,
I'm trying to understand how to get and IServiceProvider where before I could just do DependencyResolver.Current.GetService() and do not find any help in the docs.
How can this be done un a asp.net core library project?
Thanks.
P.S. The services are registered in a asp.net core web app. But I want to control execution using command query responsibility segregation pattern that I have defined in a separate asp.net core library project. .
Fabricio Martínez Tamayo
unread,
Mar 29, 2017, 4:53:32 AM3/29/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Autofac
Well the simplest solution is passing the IServiceProvider to the library through the constructer during object creation. Too bad there is no DependencyResolver.Current.GetService()
Travis Illig
unread,
Mar 29, 2017, 12:35:08 PM3/29/17
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Sign in to report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Autofac
I think you're looking for RequestServices.
Since this is an ASP.NET Core question (ie not Autofac) I'd recommend checking out the ASP.NET Core docs on DI. Tgey address your specific question.