Files

27 lines
667 B
C#
Raw Permalink Normal View History

2026-09-02 16:31:50 +08:00
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>();
}
}
}