예제 #1
0
        public ActionResult AddCustomer(Customers model)
        {
            var customersList = _manager.Get <List <Customers> >("customers");

            if (customersList != null)
            {
                var LastId = customersList.Max(x => x.Id);
                model.Id = LastId + 1;
            }
            else
            {
                model.Id = 1;
            }
            _manager.Set("customers", model);
            return(RedirectToAction("Index"));
        }
예제 #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="redisContext"></param>
 /// <param name="mobile"></param>
 /// <param name="model"></param>
 private void SetSmsVerificationCode(RedisContext redisContext, string mobile, SmsVerificationCode model)
 {
     redisContext.Set <SmsVerificationCode>(REDIS_Key, mobile + DAY_Key, model);
 }