Exemplo n.º 1
0
        public IHttpActionResult GetVersion2()
        {
            var message = new ResponseDto
            {
                Message = "hello world"
            };

            return Json(message);
        }
Exemplo n.º 2
0
        public HttpResponseMessage GetVersion1()
        {
            var message = new ResponseDto
            {
                Message = "hello world"
            };

            var result = new HttpResponseMessage(HttpStatusCode.OK)
            {
                Content = new ObjectContent<ResponseDto>(message, Configuration.Formatters.JsonFormatter)
            };

            return result;
        }