public async Task <IActionResult> Details(SEOInfo seoInfo) { if (ModelState.IsValid) { seoInfo.SiteRankings = await _rankingInfo.GetSiteRankings(seoInfo.Keywords, seoInfo.URL);; return(View(seoInfo)); } return(View()); }
public static SEOInfo GetSEO(int pageTypeID, int pageID) { string cacheKey = "GetAllSEOInfoList"; List <SEOInfo> list = new List <SEOInfo>(); if (HttpRuntime.Cache[cacheKey] != null) { list = (List <SEOInfo>)HttpRuntime.Cache[cacheKey]; } else { list = KeywordDA.GetAllSEOInfoList(); if (list == null) { list = new List <SEOInfo>(); } HttpRuntime.Cache.Insert(cacheKey, list, null, DateTime.Now.AddSeconds(CacheTime.Longest), Cache.NoSlidingExpiration); } SEOInfo seo = list.Find(f => f.PageType == pageTypeID && f.PageID == pageID); return(seo); }