public static void UpdateCustomer(NorthwindContext dbContext, string id, CustomerDTO modifiedCustomer) { try { Customer dataBaseCustomer = GetCustomerById(dbContext, id); modifiedCustomer.ModifyDataBaseCustomer(dataBaseCustomer); dbContext.SaveChanges(); } catch (Exception ex) when(ExceptionTypes.IsSqlException(ex)) { ex.SetMessage(DbExceptionMessages.FailedToUpdate(InstanceName, id, ex.InnerException)); throw; } catch (Exception ex) when(ExceptionTypes.IsDbException(ex)) { ex.SetMessage(DbExceptionMessages.UnexpectedFailure(ex)); throw; } }