Ejemplo n.º 1
0
 public async Task SendBulkCode(Dictionary <Customer, string> customerCodes)
 {
     foreach (var customer in customerCodes.Keys)
     {
         var code = customerCodes[customer];
         await codeSender.SendCode(customer, code);
     }
 }
Ejemplo n.º 2
0
        public ActionResult SendCode(Guid id)
        {
            // we send the code here

            string code     = (new Random()).Next(100000, 999999).ToString();
            var    customer = _db.Customers.FirstOrDefault(c => c.Id == id);

            if (customer != null)
            {
                _codeSender.SendCode(customer, code);
            }

            return(RedirectToAction("Index"));
        }