ServiceCollectionMap.TryAddEnumerable 方法

定义

重载

TryAddEnumerable(Type, Type, ServiceLifetime)

将给定具体类型实现的服务添加到实现给定协定的服务列表中。 仅当集合不包含同一服务和实现类型的其他注册时,才会添加该服务。

TryAddEnumerable(Type, Type, Func<IServiceProvider,Object>, ServiceLifetime)

将给定工厂实现的服务添加到实现给定协定的服务列表中。 仅当集合不包含同一服务和实现类型的其他注册时,才会添加该服务。

TryAddEnumerable(Type, Type, ServiceLifetime)

Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs

将给定具体类型实现的服务添加到实现给定协定的服务列表中。 仅当集合不包含同一服务和实现类型的其他注册时,才会添加该服务。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddEnumerable (Type serviceType, Type implementationType, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
abstract member TryAddEnumerable : Type * Type * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
override this.TryAddEnumerable : Type * Type * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
Public Overridable Function TryAddEnumerable (serviceType As Type, implementationType As Type, lifetime As ServiceLifetime) As ServiceCollectionMap

参数

serviceType
Type

服务的协定。

implementationType
Type

实现服务的具体类型。

lifetime
ServiceLifetime

服务生存期。

返回

映射,以便进一步的调用可以链接。

适用于

TryAddEnumerable(Type, Type, Func<IServiceProvider,Object>, ServiceLifetime)

Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs
Source:
ServiceCollectionMap.cs

将给定工厂实现的服务添加到实现给定协定的服务列表中。 仅当集合不包含同一服务和实现类型的其他注册时,才会添加该服务。

public virtual Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap TryAddEnumerable (Type serviceType, Type implementationType, Func<IServiceProvider,object> factory, Microsoft.Extensions.DependencyInjection.ServiceLifetime lifetime);
abstract member TryAddEnumerable : Type * Type * Func<IServiceProvider, obj> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
override this.TryAddEnumerable : Type * Type * Func<IServiceProvider, obj> * Microsoft.Extensions.DependencyInjection.ServiceLifetime -> Microsoft.EntityFrameworkCore.Infrastructure.ServiceCollectionMap
Public Overridable Function TryAddEnumerable (serviceType As Type, implementationType As Type, factory As Func(Of IServiceProvider, Object), lifetime As ServiceLifetime) As ServiceCollectionMap

参数

serviceType
Type

服务的协定。

implementationType
Type

实现服务的具体类型。

factory
Func<IServiceProvider,Object>

实现此服务的工厂。

lifetime
ServiceLifetime

服务生存期。

返回

映射,以便进一步的调用可以链接。

适用于