コード例 #1
0
        public async Task <HttpResponseMessage> GetAllPersons()
        {
            var mapper = restPersonMapperConfig.CreateMapper();
            List <RestPerson> restPersonList = mapper.Map <List <RestPerson> >(await defaultService.ReturnAllPersons());

            return(Request.CreateResponse(HttpStatusCode.OK, restPersonList));
        }
コード例 #2
0
        public HttpResponseMessage GetAllPersons()
        {
            var mapper             = restPersonMapperConfig.CreateMapper();
            List <RestPerson> list = mapper.Map <List <RestPerson> >(defaultService.ReturnAllPersons());

            return(Request.CreateResponse(HttpStatusCode.OK, list));
        }