21 lines
585 B
21 lines
585 B
2 years ago
|
using Znyc.Admin.Commons.Core.App;
|
||
|
|
||
|
namespace Znyc.Admin.Commons.IoC
|
||
|
{
|
||
|
/// <summary>
|
||
|
///IOC 容器
|
||
|
/// </summary>
|
||
|
public class IoCContainer
|
||
|
{
|
||
|
/// <summary>
|
||
|
/// 从容器中获取对象 Resolve an instance of the default requested type from the container
|
||
|
/// </summary>
|
||
|
/// <typeparam name="T">类型</typeparam>
|
||
|
/// <returns></returns>
|
||
|
/// 该方法即将废弃,请使用App.GetService<T>();
|
||
|
public static T Resolve<T>() where T : class
|
||
|
{
|
||
|
return App.GetService<T>();
|
||
|
}
|
||
|
}
|
||
|
}
|