コード例 #1
0
        public APIResultModel SetCache([FromBody] CacheViewModel cache)
        {
            ICacheBusiness cacheBusiness = CacheFactory.Instance("redis");

            var cacheResult = cacheBusiness.SetValue(cache.Key, cache.Value.ToString());

            APIResultModel result = new APIResultModel()
            {
                Success = cacheResult.Success,
                Message = cacheResult.Message
            };

            return(result);
        }
コード例 #2
0
 public CacheController(ICacheBusiness cacheBusiness)
 {
     _cacheBusiness = cacheBusiness;
 }