public IHttpActionResult GetMessage(int id)
        {
            Message poruka = MessageDB.GetMessageById(id);

            if (poruka == null)
            {
                return(BadRequest());
            }

            return(Ok(poruka));
        }
Ejemplo n.º 2
0
        public IHttpActionResult GetMessage(int id)
        {
            //FileLogger.Instance.Log("api/message/id HttpGet request", DataFormatUtil.GetFormatedLongDateTimeString(DateTime.Now));
            Message poruka = MessageDB.GetMessageById(id);

            if (poruka == null)
            {
                return(NotFound());
            }
            return(Ok(poruka));
        }
        public ActionResult Message(int?id)
        {
            if (id == null)
            {
                return(new HttpStatusCodeResult(HttpStatusCode.BadRequest));
            }
            PersonalMessage messageToView = MessageDB.GetMessageById(id);

            if (messageToView == null)
            {
                return(HttpNotFound());
            }
            return(View(messageToView));
        }