Example #1
0
        public string Get(int id)
        {
            string json = "Not found";

            if ((id < ms.messages.Count) && (id >= 0))
            {
                json = JsonSerializer.Serialize(ms.Get(id));
            }
            return(json.ToString());
        }
Example #2
0
        public ActionResult <string> Get(int id)
        {
            string json = "Not found";

            if ((id < ms.GetCountMessages()) && (id >= 0))
            {
                json = JsonSerializer.Serialize(ms.Get(id));
                return(json.ToString());
            }
            return(NotFound());
        }