public ActionResult Register(CustomerDomain model) { try { if (ModelState.IsValid) { // TO DO CustomerCRUD.AddToCustomer(model); return(View()); } return(View("Registered")); } catch (Exception ex) { ExceptionLogDomain obj = new ExceptionLogDomain(); obj.MethodName = "Register"; obj.ControllerName = "Customer"; obj.ErrorText = ex.Message; obj.StackTrace = ex.StackTrace; obj.Datetime = DateTime.Now; ExceptionLogCRUD.AddToExceptionLog(obj); return(RedirectToAction("Index", "Error")); } }