public IActionResult Navigate(int?id)
        {
            string email = User.Identity.Name;

            var customers = _context.Customers
                            .Where(c => c.Email == email)
                            .Select(id => id.CustomerId)
                            .ToList();

            int customerId = customers.First();
            var payment    = _context.Payments.Find(customerId);

            _context.Payments.Remove(payment);
            _context.SaveChanges();

            return(RedirectToAction("Index", "Home"));
        }
Пример #2
0
 public void Commit()
 {
     _context.SaveChanges();
 }