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