Files
zszq-trs/Framework/YLErp.Core/Commons/ServiceLocator.cs
T
2024-05-09 14:06:26 +08:00

24 lines
743 B
C#

using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace YieldChain.Commons
{
public class YLServiceLocator
{
public static IServiceCollection ServiceCollection { get; private set; }
public static IServiceProvider ServiceProvider { get; private set; }
public static void SetServiceProvider(IServiceProvider serviceProvider)
{
YLServiceLocator.ServiceProvider = serviceProvider;
}
public static void SetServiceCollection(IServiceCollection serviceCollection)
{
YLServiceLocator.ServiceCollection = serviceCollection;
}
}
}