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