first commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
using Microsoft.AspNetCore.Builder;
|
||||
using Microsoft.Extensions.DependencyInjection;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace JSMachine.WMS.Infrastructure
|
||||
{
|
||||
public static class GlobalServericeProvidor
|
||||
{
|
||||
public static IServiceProvider IServiceProvider { get; private set; }
|
||||
|
||||
public static void UseGlobalServiceProvider(this IApplicationBuilder builder)
|
||||
{
|
||||
IServiceProvider = builder.ApplicationServices;
|
||||
}
|
||||
|
||||
public static T GetService<T>()
|
||||
{
|
||||
|
||||
return IServiceProvider.GetService<T>();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user