public void Remove(RedirectItem item) { lock (Locker) { var redirects = _cacheRetriever.FindAll().ToList(); redirects.RemoveAll(x => x.ItemId == item.ItemId); HttpContext.Current.Cache.Insert(_configurationSettings.CacheId, redirects); } }
public void Setup() { _redirectItem = new RedirectItem { RedirectUrl = "/extension", External = false, ItemId = new Guid(), Site = "", Target = "/Test", TargetQueryString = "" }; _redirectItemToTargetUrl = new RedirectItemToTargetUrl(); }
public string Create(RedirectItem item) { if (item == null) throw new Exception("Item cannot be null"); var targetUrl = item.Target; if (!string.IsNullOrEmpty(item.TargetQueryString)) { targetUrl = string.Format("{0}?{1}", targetUrl, item.TargetQueryString); } return targetUrl; }