//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 'Customer' based on the 'UcCompanyName' unique constraint.</summary> public CustomerResponse Get(CustomerUcCompanyNameRequest request) { if (Validator != null) { Validator.ValidateAndThrow(new Customer { CompanyName = request.CompanyName }, "UcCompanyName"); } OnBeforeGetCustomerUcCompanyNameRequest(request); var output = Repository.Fetch(request); OnAfterGetCustomerUcCompanyNameRequest(request, output); if (output.Result == null) { throw new HttpError(HttpStatusCode.NotFound, "NullReferenceException", "Customer matching [CompanyName = {0}] does not exist".Fmt(request.CompanyName)); } return(output); }
partial void OnAfterGetCustomerUcCompanyNameRequest(CustomerUcCompanyNameRequest request, CustomerResponse response);
partial void OnBeforeGetCustomerUcCompanyNameRequest(CustomerUcCompanyNameRequest request);