示例#1
0
        public JsonResult GetNewsByGuid(Guid guid)
        {
            try
            {
                var news = _newsManager.GetNewsByGuid(guid);
                if (news == null)
                {
                    throw new Exception("No news with the given guid");
                }

                return(new JsonResult(new { success = true, data = news }));
            }
            catch (Exception ex)
            {
                return(new JsonResult(new { success = false, msg = ex.Message }));
            }
        }