Exemple #1
0
        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);
        }
Exemple #2
0
 partial void OnAfterCustomerDeleteRequest(CustomerDeleteRequest request, SimpleResponse <bool> deleted);
Exemple #3
0
 partial void OnBeforeCustomerDeleteRequest(CustomerDeleteRequest request);