public CustomUrl FindByRequestedUrl(string requestedUrl, CustomUrlType type) { var match = requestedUrl.ToLowerInvariant(); var storeId = Context.CurrentStore.Id; return (FindFirstPoco(cu => cu.StoreId == storeId && cu.RequestedUrl == match && cu.SystemDataType == (int)type)); }
public void Register301(string requestedUrl, string redirectUrl, string objectId, CustomUrlType customUrlType, RequestContext context, MerchantTribeApplication app) { bool AlreadyInUse = Utilities.UrlRewriter.IsUrlInUse(requestedUrl, string.Empty, context, app); if (AlreadyInUse) { return; } CustomUrl c = new CustomUrl(); c.IsPermanentRedirect = true; c.RedirectToUrl = redirectUrl; c.RequestedUrl = requestedUrl; c.StoreId = app.CurrentRequestContext.CurrentStore.Id; c.SystemData = objectId; c.SystemDataType = customUrlType; Create(c); UpdateAllUrlsForObject(objectId, redirectUrl); }
public void Register301(string requestedUrl, string redirectUrl, string objectId, CustomUrlType customUrlType, HccRequestContext context, HotcakesApplication app) { var AlreadyInUse = UrlRewriter.IsUrlInUse(requestedUrl, string.Empty, context, app); if (AlreadyInUse) { return; } var customUrl = new CustomUrl { IsPermanentRedirect = true, RedirectToUrl = redirectUrl, RequestedUrl = requestedUrl, StoreId = app.CurrentRequestContext.CurrentStore.Id, SystemData = objectId, SystemDataType = customUrlType }; Create(customUrl); UpdateAllUrlsForObject(objectId, redirectUrl); }