Example #1
0
        public IActionResult OnGet([FromQuery] int?id, string slug)
        {
            MetaTags m = new MetaTags(option);

            m.Title       = "Demo list";
            m.Description = "Codepedia.info complete list of programming tutorials examples";


            if (id >= 0)
            {
                demo      = repositoryData.GetDemoById((int)id);
                m.Web_Url = option.Value.BaseUrl + "/editor-example?id=" + id.ToString();
            }
            else if (string.IsNullOrEmpty(slug))
            {
                demoList  = repositoryData.GetAllDemoList();
                m.Web_Url = option.Value.BaseUrl + "/editor-example";
            }
            else
            {
                demo      = repositoryData.GetDemoBySlug(slug);
                m.Web_Url = option.Value.BaseUrl + "/editor-example/" + slug;
            }

            MyMetaTags = m;

            return(Page());
        }
Example #2
0
 public ActionResult <IEnumerable <Demos> > GetDemoList()
 {
     return(repositoryData.GetAllDemoList().ToList());
 }