예제 #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());
        }
예제 #2
0
        public IActionResult OnGet(int?DemoId)
        {
            if (DemoId == null)
            {
                return(Page());
            }

            demos = repositoryData.GetDemoById((int)DemoId);
            if (demos == null)
            {
                return(NotFound());
            }

            return(Page());
        }