public void ConfigureConfigureServices(IServiceCollection services) { var context = new ServiceCollectionContext(services); foreach (var moduleDescriptor in Modules) { try { moduleDescriptor.Instance.PreConfigureServices(context); } catch (Exception ex) { throw new Exception("An error occurred during PreConfigureServices phase of the module " + moduleDescriptor.ModuleType.AssemblyQualifiedName + ". See the inner exception for details.", ex); } } foreach (var moduleDescriptor in Modules) { try { moduleDescriptor.Instance.ConfigureServices(context); } catch (Exception ex) { throw new Exception("An error occurred during ConfigureServices phase of the module " + moduleDescriptor.ModuleType.AssemblyQualifiedName + ". See the inner exception for details.", ex); } } foreach (var moduleDescriptor in Modules) { try { moduleDescriptor.Instance.PostConfigureServices(context); } catch (Exception ex) { throw new Exception("An error occurred during PostConfigureServices phase of the module " + moduleDescriptor.ModuleType.AssemblyQualifiedName + ". See the inner exception for details.", ex); } } }
public virtual void PreConfigureServices(ServiceCollectionContext context) { }