public class CategoryController : BaseController
{
private static CategoryConcrete cc = null;
/// <summary>
/// 构造函数,初始化
/// </summary>
public CategoryController()
{
if (cc == null)
cc = new CategoryConcrete();
}
public actionResult Index(int? id)
{
CategoryDetails cd = cc.GetCategory(id);
return View(cd);
}
}
在这里我定义这个cc为静态的有用吗?
缥缈止盈
弑天下