Azure-Samples / service-fabric-dotnet-getting-started

Get started with Service Fabric with these simple introductory sample projects.
MIT License
230 stars 329 forks source link

Dependency Injection with .net core #69

Open MattHartz opened 6 years ago

MattHartz commented 6 years ago

Hi,

I'm using service fabric with a .net core service that registers a few dependent web socket classes in that Startup class. I would like to give the service class the ability to access these classes via dependency injection but I do not see a way to do that with the way the service is initialized.

For example, in the main function is where the service registration is called, but it isn't until CreateServiceInstanceListeners until Startup.cs is called which initially registers the dependencies.

Is there anyway to achieve this?

Thanks!