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为静态的有用吗?
- 2 回答
- 0 关注
- 527 浏览
添加回答
举报
0/150
提交
取消