I'm migrating some projects from StructureMap to Lamar, and although the migration has been mostly transparent, I really miss some API to specify the lifecycle of the services when scanning an assembly.
StructureMap's OnAddedPluginTypes was not carried over to Lamar, and it seems there's no equivalent for these use cases:
For the time being I solved the issue with a couple of custom conventions. Basically I ripped off GenericConnectionScanner and DefaultConventionScanner, and changed them so they add singletons.
What's the official take on this? Will you accept a PR that modifies said scanners/conventions (and potentially others? Those are the ones I'm currently using, but I'm not that familiar with StructureMap and/or Lamar beyond the basics) to optionally accept a lifecycle? And chagning the extension methods so they can accept an optional lifecycle to pass to the convention?
I'd happily take a pull request for that. You can use attributes too, with the obvious downsides. I'm completely fine with enhancing the existing registration conventions
I'm migrating some projects from StructureMap to Lamar, and although the migration has been mostly transparent, I really miss some API to specify the lifecycle of the services when scanning an assembly.
StructureMap's
OnAddedPluginTypes
was not carried over to Lamar, and it seems there's no equivalent for these use cases:For the time being I solved the issue with a couple of custom conventions. Basically I ripped off
GenericConnectionScanner
andDefaultConventionScanner
, and changed them so they add singletons.What's the official take on this? Will you accept a PR that modifies said scanners/conventions (and potentially others? Those are the ones I'm currently using, but I'm not that familiar with StructureMap and/or Lamar beyond the basics) to optionally accept a lifecycle? And chagning the extension methods so they can accept an optional lifecycle to pass to the convention?
Something around these lines:
So, to sum up, I guess the issue is two folded: