ava-innersource / Liquid-Application-Framework-1.0-deprecated

Liquid is a framework to speed up the development of microservices
MIT License
25 stars 14 forks source link

Workbench.{Service} doesn't call Initialize #155

Open bruno-brant opened 4 years ago

bruno-brant commented 4 years ago

Workbench seems to be responsible for calling Initialize on each service it provides, as it can be seen from the method GetRegisteredService:

https://github.com/Avanade/Liquid-Application-Framework/blob/8f03b94252db859c61992662bc7c84fced8fee64/src/Liquid.Base/WorkBench.cs#L93-L99

However, for some reason, there's a very similar method called GetService that doesn't call initialization, and that method is the one used by the public static properties like Telemetry, Repository, etc.

https://github.com/Avanade/Liquid-Application-Framework/blob/8f03b94252db859c61992662bc7c84fced8fee64/src/Liquid.Base/WorkBench.cs#L108-L118

This can lead to some bugs.