BetterCms.Module.Pages.Services.DefaultRedirectService.ValidateRedirectExists C# (CSharp) Метод

ValidateRedirectExists() публичный Метод

Checks, if such redirect exists.
public ValidateRedirectExists ( string pageUrl, System.Guid id = null ) : void
pageUrl string The page URL.
id System.Guid The redirect id.
Результат void
        public void ValidateRedirectExists(string pageUrl, Guid? id = null)
        {
            var redirect = GetPageRedirect(pageUrl, id);

            if (redirect != null)
            {
                var message = string.Format(PagesGlobalization.SaveRedirect_RedirectExists_Message, pageUrl);
                var logMessage = string.Format("Redirect from URL {0} already exists.", pageUrl);
                throw new ValidationException(() => message, logMessage);
            }
        }