Open jammycakes opened 5 years ago
The infrastructure is in place: conventions can be registered through custom implementations of IServiceDefinition
; this means that they will be resolved in the order of registration.
Main thing needed is to create a fluent convention registration API. Something like this:
module.Given(type => Criterion(type))
.Find(type => GetImplementations(type));
Possible shortcuts:
module.Given
.Condition(type => type.Name.StartsWith("I") && type.IsInterface)
.Condition(type => type.ImplementsOrExtends(IRepository))
.FindMatchingImplementationInSameNamespace();
module.Given
.Interface()
.In(assembly)
.In(namespace, ...)
.Implementing<otherType>()
.FindMatchingImplementationsInSameAssembly();
module.Given
.Interface()
.In(assembly, namespace, includeSubsidiaryNamespaces)
.FindMatchingImplementationsInAssembly(implementingAssembly);
Some notes: