后台管理_GMS_1

1.ServiceContext .存在与页面缓存周期 HttpContext.Current.Items.

  //GMS.Web

  public class WebControllerBase:FrameControllerBase{

    public virtual IAccountService AccountService{

      get{

        return ServiceContext.Current.AccountService;

        }

    }

  }

  //GMS.Web

  public class ServiceContext{

    public  static ServiceContext Current{

      get{

          return CacheHelper.GetItem<ServiceContext>("ServiceContext",()=>new ServiceContext());

        }

      }

   }

猜你喜欢

转载自www.cnblogs.com/sujingnuli/p/9172120.html
今日推荐