Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • OK, great, but... each instance of the client needs to have it's own instance of the service initialized with different context data. That context data is not static or known beforehand so it cannot be injected by DI in the constructor. Then, how do I get/create instance of the service together with other dependencies in my clients? Commented May 2, 2019 at 12:48
  • hmm wont that static constructor run before you set the context? and initialize in the constructor risks exceptions Commented May 2, 2019 at 12:49
  • I am leaning towards injecting factory that can create and initialize the service with the given context data (rather than injecting service itself), but I am not sure if there are better solutions. Commented May 2, 2019 at 12:54
  • @Ewan You are right. I will try to find a solution for it. But before that, I will remove it for now. Commented May 2, 2019 at 12:57