zoukankan      html  css  js  c++  java
  • 后台管理_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());

            }

          }

       }

    2.通过ServiceFactory创建Service ,并且增加AOP .

  • 相关阅读:
    poj 2391 Ombrophobic Bovines
    混合欧拉回路poj 1637 Sightseeing tour
    POJ1149-PIGS
    C
    B
    A
    C
    B
    A
    O
  • 原文地址:https://www.cnblogs.com/sujingnuli/p/9172120.html
Copyright © 2011-2022 走看看