예제 #1
0
        public async Task <HttpResponseMessage> GetPersonById(Guid id)
        {
            var        mapper = restPersonMapperConfig.CreateMapper();
            RestPerson person = mapper.Map <RestPerson>(await defaultService.ReturnPersonById(id));

            if (person == null)
            {
                return(Request.CreateResponse(HttpStatusCode.NotFound, String.Format("There is no person with Id: {0}", id)));
            }
            return(Request.CreateResponse(HttpStatusCode.OK, person));
        }