Spring.Net这样注入的写法是否可以:
private static Spring.Context.IApplicationContext _application;
private static Spring.Context.IApplicationContext ApplicationContext
{
get
{
if (_application == null)
{
_application = Spring.Context.Support.ContextRegistry.GetContext();
}
return _application;
}
}
public static T GetObject<T>(string code)
{
return GetObject<T>(code, null);
}
public static object GetObject(string code, object[] objs)
{
return ApplicationContext.GetObject(code, objs);
}
///////////////////////////调用/////////////////////////////
private INews _news = null;
private INews BizNews
{
get
{
if (_news == null)
{
_news = GetObject<INews>("Biz.News");
}
return _news;
}
}
、、、、、、、、、、、、、、、、、、、、、、
这是运行后报的错误: