Пример #1
0
        // GET: News
        public ActionResult Index(NewsSearch search)
        {
            var dto  = _getNewsCommand.Execute(search);
            var user = HttpContext.Session.GetObjectFromJson <UserDto>();

            return(View(dto));
        }
Пример #2
0
 public ActionResult <NewsDto> Get([FromQuery] NewsSearch search)
 {
     try
     {
         var dto = _getNewsCommand.Execute(search);
         return(Ok(dto));
     }
     catch (EntityNotFoundException)
     {
         return(Conflict("There's no data for your request."));
     }
 }