Esempio n. 1
0
        public JsonNews NewsList()
        {
            JsonNews             jsonNews    = new JsonNews();
            NewsViewModel        linknewsobj = new NewsViewModel();
            List <NewsViewModel> linklistobj = new List <NewsViewModel>();

            try
            {
                var ListNews = _link.LinkType();
                foreach (var item in ListNews)
                {
                    linknewsobj.LinkId = item.Id;
                    linknewsobj.Title  = item.Title;
                    linknewsobj.Icon   = item.Icon;
                    linklistobj.Add(linknewsobj);
                }
                jsonNews.Result = linklistobj;
                return(jsonNews);
            }
            catch (Exception ex)
            {
                string mes = ex.Message;
                return(jsonNews);
            }
        }
Esempio n. 2
0
        public JsonPadcast PadcastLIst()
        {
            JsonPadcast             jsonPadcast    = new JsonPadcast();
            List <PadcastViewModel> PadcastListOBJ = new List <PadcastViewModel>();

            try
            {
                var Padcasts = _link.LinkType();
                foreach (var item in Padcasts)
                {
                    PadcastViewModel padcastOBJ = new PadcastViewModel();
                    padcastOBJ.Title       = item.Title;
                    padcastOBJ.Link        = item.Url;
                    padcastOBJ.Description = item.Description;
                    PadcastListOBJ.Add(padcastOBJ);
                }
                jsonPadcast.Result = PadcastListOBJ;
                return(jsonPadcast);
            }
            catch (Exception ex)
            {
                _ = ex.Message;
                return(jsonPadcast);
            }
        }