public SimpleResponse <bool> Any(CustomerDeleteRequest request) { if (Validator != null) { Validator.ValidateAndThrow(new Customer { CustomerId = request.CustomerId }, ApplyTo.Delete); } OnBeforeCustomerDeleteRequest(request); var output = Repository.Delete(request); OnAfterCustomerDeleteRequest(request, output); if (!output.Result) { throw new HttpError(HttpStatusCode.NotFound, "NullReferenceException", "Customer matching [CustomerId = {0}] does not exist".Fmt(request.CustomerId)); } return(output); }
partial void OnAfterCustomerDeleteRequest(CustomerDeleteRequest request, SimpleResponse <bool> deleted);
partial void OnBeforeCustomerDeleteRequest(CustomerDeleteRequest request);