Quantcast
Channel: Web API
Viewing all articles
Browse latest Browse all 4850

return JsonResult from WebAPI

$
0
0

hello all,

i knew its easy to return JsonResult type of data from controller but, is it possible from WebApi because, i have written below code

[HttpGet]
        [Route("api/GetMyData")]
        public JsonResult GetMyData(string strFromDate, string strToDate)
        {
              /*some db operation*/
            return Json(new { myOutput = "test"});
        }

im getting exception as "Using the generic type 'JsonResult<T>' requires 1 type arguments"

experts please help me to resolve this exception?

thanks in advance


Viewing all articles
Browse latest Browse all 4850

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>