public void AddCustomUrl(string url, string customPart) { var customUrl = new CustomUrl { Url = url, CustomPart = customPart }; customUrlRepository.Add(customUrl); customUrlRepository.Save(); customUrlsCache.Add(customPart, url); }
public ActionResult Create(CustomUrl customUrl) { try { repo.Add(customUrl); repo.Save(); return(RedirectToAction("Index")); } catch { return(View(customUrl)); } }
public void AddCustomUrl(CustomUrl customUrl) { customUrlRepository.Add(customUrl); customUrlRepository.Save(); customUrlsCache.TryAdd(customUrl.CustomPart, customUrl.Url); }