Exemple #1
0
        //Unique constraint request go first (the order matters in service stack)
        //If the PK constraint was first, it could be used by ServiceStack instead
        //of the UC route (this is how Route order is controlled)
        /// <summary>Gets a specific 'Supplier' based on the 'UcSupplierName' unique constraint.</summary>
        public SupplierResponse Get(SupplierUcSupplierNameRequest request)
        {
            if (Validator != null)
            {
                Validator.ValidateAndThrow(new Supplier {
                    CompanyName = request.CompanyName
                }, "UcSupplierName");
            }

            OnBeforeGetSupplierUcSupplierNameRequest(request);
            var output = Repository.Fetch(request);

            OnAfterGetSupplierUcSupplierNameRequest(request, output);
            if (output.Result == null)
            {
                throw new HttpError(HttpStatusCode.NotFound, "NullReferenceException", "Supplier matching [CompanyName = {0}]  does not exist".Fmt(request.CompanyName));
            }
            return(output);
        }
Exemple #2
0
 partial void OnAfterGetSupplierUcSupplierNameRequest(SupplierUcSupplierNameRequest request, SupplierResponse response);
Exemple #3
0
 partial void OnBeforeGetSupplierUcSupplierNameRequest(SupplierUcSupplierNameRequest request);