Update MvcCoreServiceCollectionExtensions.cs
This commit is contained in:
parent
8f8bf5af34
commit
f32d0f2505
|
|
@ -87,7 +87,7 @@ namespace Microsoft.Extensions.DependencyInjection
|
||||||
private static T GetServiceFromCollection<T>(IServiceCollection services)
|
private static T GetServiceFromCollection<T>(IServiceCollection services)
|
||||||
{
|
{
|
||||||
return (T)services
|
return (T)services
|
||||||
.FirstOrDefault(d => d.ServiceType == typeof(T))
|
.LastOrDefault(d => d.ServiceType == typeof(T))
|
||||||
?.ImplementationInstance;
|
?.ImplementationInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue