예제 #1
0
        public void ModelCreateEventHandler <IService, TModel>(object sender, Service.ModelCacheEventArgs e)
        {
            string         key     = e.Key;
            int            id      = e.ID;
            IBase <TModel> service = (IBase <TModel>)ApplicationContainer.Container.Resolve <IService>();
            TModel         model   = service.GetFromDB(id);

            RedisHelper.SetEntity(key, model);
            log4net.LogManager.GetLogger("info").Info(string.Format("Model Create. Service:{0}.ID:{1},KEY:{2}", typeof(IService).Name, e.ID, e.Key));
        }