Esempio n. 1
0
        public SimpleResponse <bool> Any(SupplierDeleteRequest request)
        {
            if (Validator != null)
            {
                Validator.ValidateAndThrow(new Supplier {
                    SupplierId = request.SupplierId
                }, ApplyTo.Delete);
            }

            OnBeforeSupplierDeleteRequest(request);
            var output = Repository.Delete(request);

            OnAfterSupplierDeleteRequest(request, output);
            if (!output.Result)
            {
                throw new HttpError(HttpStatusCode.NotFound, "NullReferenceException", "Supplier matching [SupplierId = {0}]  does not exist".Fmt(request.SupplierId));
            }
            return(output);
        }
Esempio n. 2
0
 partial void OnAfterSupplierDeleteRequest(SupplierDeleteRequest request, SimpleResponse <bool> deleted);
Esempio n. 3
0
 partial void OnBeforeSupplierDeleteRequest(SupplierDeleteRequest request);