JasperFx / lamar

Fast Inversion of Control Tool and Successor to StructureMap
https://jasperfx.github.io/lamar
MIT License
572 stars 119 forks source link

try show different behavior from structuremap #81

Closed arishlabroo closed 6 years ago

arishlabroo commented 6 years ago

Adding a decorator is ConfigureContainer takes effect for structuremap but not for lamar. This pull request should not be merged as it adds structuremap dependency, but I wanted to leave it in there to show different behavior.

jeremydmiller commented 6 years ago

@arishlabroo I would have closed this anyway;) Lamar isn't going to be supporting that behavior.

arishlabroo commented 6 years ago

@jeremydmiller . Lamar supports Decorators though. Also, the problem is only when using the webhostbuilder. In a console app, or standalone unit test, the decorator behavior is correct. As I mentioned in the issue https://github.com/JasperFx/lamar/issues/83 , not sure if the behavior is limited to decorators honestly.

jeremydmiller commented 6 years ago

"Lamar supports Decorators though" -- uh, huh. Calling ConfigureContainer() just to add policies and decorators requires Lamar to effectively rebuild the container from scratch. I'm not enthusiastic about that. SM got away with that kind of "you can change me anytime" by making all decisions at runtime. And that's what made SM much, much slower compared to Lamar