27 lines
667 B
C#
27 lines
667 B
C#
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>();
|
|
}
|
|
}
|
|
}
|