/// <inheritdoc cref="ServiceCollectionDescriptorExtensions.TryAddScoped{TService, TImplementation}(IServiceCollection)"/>
 /// <returns>A reference to this instance after the operation has completed.</returns>
 public static IServiceCollection TryAddScoped <TService, TImplementation>(this IServiceCollection collection)
     where TService : class
     where TImplementation : class, TService
 {
     ServiceCollectionDescriptorExtensions.TryAddScoped <TService, TImplementation>(collection);
     return(collection);
 }
Пример #2
0
		public void AddCoreServices(IServiceCollection services)
		{
			ServiceCollectionDescriptorExtensions.TryAddScoped<IShellStateUpdater, ShellStateUpdater>(services);
			ServiceCollectionDescriptorExtensions.TryAddScoped<IShellStateManager, NullShellStateManager>(services);
			dummyVar0 = ServiceCollectionServiceExtensions.AddScoped<IShellDescriptorManagerEventHandler, ShellStateCoordinator>(services);
			return;
		}
 /// <inheritdoc cref="ServiceCollectionDescriptorExtensions.TryAddScoped(IServiceCollection, Type, Type)"/>
 /// <returns>A reference to this instance after the operation has completed.</returns>
 public static IServiceCollection TryAddScoped(this IServiceCollection collection, Type service, Type implementationType)
 {
     ServiceCollectionDescriptorExtensions.TryAddScoped(collection, service, implementationType);
     return(collection);
 }
 /// <inheritdoc cref="ServiceCollectionDescriptorExtensions.TryAddScoped{TService}(IServiceCollection)"/>
 /// <returns>A reference to this instance after the operation has completed.</returns>
 public static IServiceCollection TryAddScoped <TService>(this IServiceCollection collection)
     where TService : class
 {
     ServiceCollectionDescriptorExtensions.TryAddScoped <TService>(collection);
     return(collection);
 }
 /// <inheritdoc cref="ServiceCollectionDescriptorExtensions.TryAddScoped(IServiceCollection, Type, Func{IServiceProvider, object})"/>
 /// <returns>A reference to this instance after the operation has completed.</returns>
 public static IServiceCollection TryAddScoped(this IServiceCollection collection, Type service, Func <IServiceProvider, object> implementationFactory)
 {
     ServiceCollectionDescriptorExtensions.TryAddScoped(collection, service, implementationFactory);
     return(collection);
 }
 /// <inheritdoc cref="ServiceCollectionDescriptorExtensions.TryAddScoped{TService}(IServiceCollection, Func{IServiceProvider, TService})"/>
 /// <returns>A reference to this instance after the operation has completed.</returns>
 public static IServiceCollection TryAddScoped <TService>(this IServiceCollection collection, Func <IServiceProvider, TService> implementationFactory)
     where TService : class
 {
     ServiceCollectionDescriptorExtensions.TryAddScoped(collection, implementationFactory);
     return(collection);
 }