Beispiel #1
0
        public async override Task Compensate(SagaContext <string> context)
        {
            var customer = await customerRepo.FindByUser(context.Data.User);

            if (customer == null)
            {
                return;
            }

            await customerGateway.Delete(customer);

            await customerRepo.Delete(customer);
        }
Beispiel #2
0
        public ActionResult Delete(int id, Customer customerDelete)
        {
            try
            {
                if (customerDelete == null)
                {
                    return(null);
                }
                var customer = customerGateway.Read(id);
                if (customer != null)
                {
                    customerGateway.Delete(customer);
                }


                return(RedirectToAction("Index"));
            }
            catch
            {
                return(View());
            }
        }