mirror of
				https://github.com/nsnail/FreeSql.git
				synced 2025-11-04 09:15:27 +08:00 
			
		
		
		
	
		
			
				
	
	
		
			26 lines
		
	
	
		
			734 B
		
	
	
	
		
			C#
		
	
	
	
	
	
			
		
		
	
	
			26 lines
		
	
	
		
			734 B
		
	
	
	
		
			C#
		
	
	
	
	
	
using System;
 | 
						|
using System.Collections.Generic;
 | 
						|
using System.Text;
 | 
						|
using Microsoft.Extensions.DependencyInjection;
 | 
						|
 | 
						|
namespace FreeSql.Provider.QuestDb
 | 
						|
{
 | 
						|
    internal class QuestDbContainer
 | 
						|
    {
 | 
						|
        //作用于HttpClientFatory
 | 
						|
        private static IServiceCollection Services;
 | 
						|
        internal static IServiceProvider ServiceProvider { get; private set; }
 | 
						|
 | 
						|
        internal static void Initialize(Action<IServiceCollection> service)
 | 
						|
        {
 | 
						|
            Services = new ServiceCollection();
 | 
						|
            service?.Invoke(Services);
 | 
						|
            ServiceProvider = Services.BuildServiceProvider();
 | 
						|
        }
 | 
						|
 | 
						|
        internal static T GetService<T>()
 | 
						|
        {
 | 
						|
            return ServiceProvider.GetService<T>();
 | 
						|
        }
 | 
						|
    }
 | 
						|
} |