You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

38 lines
891 B
C#

using DotNetCore.CAP;
using Microsoft.Extensions.DependencyInjection;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Common
{
/// <summary>
/// IOC
/// </summary>
public class IOC
{
/// <summary>
/// IServiceCollection 对象
/// </summary>
public static IServiceCollection container { get; set; }
/// <summary>
/// ICo模式实例化
/// </summary>
/// <typeparam name="T"></typeparam>
/// <returns></returns>
public static T AddServer<T>()
{
ServiceProvider provider = container.BuildServiceProvider();
return provider.GetService<T>();
}
/// <summary>
///
/// </summary>
public static ICapPublisher MQpushserver {get;set;}
}
}