// GET: News public ActionResult Index(NewsSearch search) { var dto = _getNewsCommand.Execute(search); var user = HttpContext.Session.GetObjectFromJson <UserDto>(); return(View(dto)); }
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.")); } }