public static IServiceCollection AddFromAssembly(this IServiceCollection serviceCollection, Assembly assembly) { var builder = new ServiceDescriptorsBuilder().AddSourceAssembly(assembly); BuildAndFill(serviceCollection, builder); return serviceCollection; }
private static void BuildAndFill(IServiceCollection serviceCollection, ServiceDescriptorsBuilder builder) { builder.AddTypesProvider(new ExistingServiceCollectionTypesProvider(serviceCollection)); var serviceDescriptors = builder.Build(); MergeServiceDescriptions(serviceCollection, serviceDescriptors); }
private static ServiceDescriptorsBuilder Builder(string namespaceEndWith = "TestServices") { var assembly = GetTestAssembly(); var builder = new ServiceDescriptorsBuilder().AddSourceAssembly(assembly); return(builder.AddTypesConvention(new NamespaceEndWithTestServicesConvention(namespaceEndWith))); }
public static IServiceCollection AddFromAssembly(this IServiceCollection serviceCollection, Assembly assembly) { var builder = new ServiceDescriptorsBuilder().AddSourceAssembly(assembly); BuildAndFill(serviceCollection, builder); return(serviceCollection); }
public void Builder_works_correct_even_when_there_is_not_assembly_definied() { // Arrange var builder = new ServiceDescriptorsBuilder(); // Act builder.Build(); }