Beispiel #1
0
 /// <summary>
 /// Creates an <see cref="IServiceProvider"/> containing services from the provided <see cref="IServiceCollection"/>
 /// optionaly enabling scope validation.
 /// </summary>
 /// <param name="services">The <see cref="IServiceCollection"/> containing service descriptors.</param>
 /// <param name="validateScopes">
 /// <c>true</c> to perform check verifying that scoped services never gets resolved from root provider; otherwise <c>false</c>.
 /// </param>
 /// <returns>The <see cref="IServiceProvider"/>.</returns>
 public static ServiceProvider BuildServiceProvider(this AliceServiceCollection services, bool validateScopes)
 {
     return(services.BuildServiceProvider(new ServiceProviderOptions {
         ValidateScopes = validateScopes
     }));
 }
 /// <inheritdoc />
 public IServiceProvider CreateServiceProvider(AliceServiceCollection containerBuilder)
 {
     return(containerBuilder.BuildServiceProvider(_options));
 }