อ่านในภาษาอังกฤษ

แชร์ผ่าน


NamedServiceCollectionExtensions Class

Definition

Extensions for adding named services to INamedServiceProvider<TService>.

C#
public static class NamedServiceCollectionExtensions
Inheritance
NamedServiceCollectionExtensions

Methods

AddNamedSingleton<TService,TImplementation>(IServiceCollection, String)

Adds a singleton named service of the type specific in TService to the specified IServiceCollection.

AddNamedSingleton<TService>(IServiceCollection, String, Func<IServiceProvider,TService>)

Adds a singleton named service of the type specific in TService to the specified IServiceCollection.

AddNamedSingleton<TService>(IServiceCollection, String)

Adds a singleton named service of the type specific in TService to the specified IServiceCollection.

AddNamedTransient<TService>(IServiceCollection, String, Func<IServiceProvider,TService>)

Adds a transient named service of the type specific in TService to the specified IServiceCollection.

AddNamedTransient<TService>(IServiceCollection, String)

Adds a transient named service of the type specific in TService to the specified IServiceCollection.

Applies to

ผลิตภัณฑ์ เวอร์ชัน
.NET 8 (package-provided), 9 (package-provided), 10 (package-provided)