Ejemplo n.º 1
0
        public void AddCustomUrl(string url, string customPart)
        {
            var customUrl = new CustomUrl {
                Url = url, CustomPart = customPart
            };

            customUrlRepository.Add(customUrl);
            customUrlRepository.Save();
            customUrlsCache.Add(customPart, url);
        }
Ejemplo n.º 2
0
 public ActionResult Create(CustomUrl customUrl)
 {
     try
     {
         repo.Add(customUrl);
         repo.Save();
         return(RedirectToAction("Index"));
     }
     catch
     {
         return(View(customUrl));
     }
 }
Ejemplo n.º 3
0
 public void AddCustomUrl(CustomUrl customUrl)
 {
     customUrlRepository.Add(customUrl);
     customUrlRepository.Save();
     customUrlsCache.TryAdd(customUrl.CustomPart, customUrl.Url);
 }