public ActionResult GetNews(int condominiumId) { try { var news = _newService.GetNewsByCondominium(condominiumId); response.StatusCode = StatusCodes.Status200OK; response.Status = "OK"; response.Result = news; return(Ok(response)); } catch (Exception e) { response.StatusCode = StatusCodes.Status400BadRequest; response.Status = "BAD REQUEST"; response.Message = e.Message; return(BadRequest(response)); } }
public ActionResult <IEnumerable <News> > GetNews(int condominiumId) { return(Ok(newService.GetNewsByCondominium(condominiumId))); }