示例#1
0
        /// <summary>Gets a specific 'Region' based on it's primary key.</summary>
        public RegionResponse Get(RegionPkRequest request)
        {
            if (Validator != null)
            {
                Validator.ValidateAndThrow(new Region {
                    RegionId = request.RegionId
                }, "PkRequest");
            }

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

            OnAfterGetRegionPkRequest(request, output);
            if (output.Result == null)
            {
                throw new HttpError(HttpStatusCode.NotFound, "NullReferenceException", "Region matching [RegionId = {0}]  does not exist".Fmt(request.RegionId));
            }
            return(output);
        }
示例#2
0
 partial void OnAfterGetRegionPkRequest(RegionPkRequest request, RegionResponse response);
示例#3
0
 partial void OnBeforeGetRegionPkRequest(RegionPkRequest request);