You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
As a developer, I would like to automatically configure a handler based on the types discovered in a certain assembly or plugin directory, so that I do not need to wire everything by myself.
Note, that this requirement somehow violates the idea of reducing autowire magic by specifying all dependencies manually. Nevertheless, for some use cases (such as plugins) or bigger projects, this could be useful.
varapi=Scanner.Build<LayoutBuilder>().From(Assembly.GetExecutingAssembly())// or IResource or IResourceTree.Filter<MyAttribute>().With((builder,assembly,type)=>builder.AddService(...));
Acceptance criteria
The functionality is provided within a new module (e.g. GenHTTP.Modules.Scanner)
Any handler can be built (not just layouts)
Discovered types can be filtered (e.g. by attribute)
The lambda may also discard a type if needed (e.g. by returning null)
The scanner does not detect changes automatically (but probably can be triggered to re-scan if needed)
The resulting builder can be further adjusted as needed (e.g. .Configure(builder => builder.Index(...)))
There are acceptance tests covering the functionality
The text was updated successfully, but these errors were encountered:
As a developer, I would like to automatically configure a handler based on the types discovered in a certain assembly or plugin directory, so that I do not need to wire everything by myself.
Note, that this requirement somehow violates the idea of reducing autowire magic by specifying all dependencies manually. Nevertheless, for some use cases (such as plugins) or bigger projects, this could be useful.
Idea via @ukionik: https://github.com/ukionik/UkiRggRandomizer/blob/ddabbbe33ff3865ba08a3333138e30bd69d13082/UkiRandomizer/UkiRandomizer/Core/ConfigExtensions.cs#L30
Example
Acceptance criteria
GenHTTP.Modules.Scanner
)null
).Configure(builder => builder.Index(...))
)The text was updated successfully, but these errors were encountered: