C# Класс BetterCms.Module.Pages.Services.DefaultRedirectService

Наследование: IRedirectService
Показать файл Открыть проект

Открытые методы

Метод Описание
CreateRedirectEntity ( string pageUrl, string redirectUrl ) : Redirect

Checks if such redirect doesn't exists yet and creates new redirect entity.

DefaultRedirectService ( IUnitOfWork unitOfWork, IUrlService urlService, IRepository repository ) : System

Initializes a new instance of the DefaultRedirectService class.

DeleteRedirect ( System.Guid id, int version ) : bool
GetAllRedirects ( ) : IList

Gets the list with all redirects.

GetPageRedirect ( string pageUrl, System.Guid id = null ) : Redirect

Gets redirect, if such redirect exists.

GetRedirect ( string url ) : string

Gets the redirect for given url.

SaveRedirect ( ViewModels model, bool createIfNotExists = false ) : Redirect
ValidateForCircularLoop ( string pageUrl, string redirectUrl, System.Guid id = null ) : void

Validates urls: checks if the the circular loop exists.

ValidateRedirectExists ( string pageUrl, System.Guid id = null ) : void

Checks, if such redirect exists.

Приватные методы

Метод Описание
RecursiveCircularLoop ( IList redirects, string redirectUrl, List checkedIds, string startPageUrl, string startRedirectUrl ) : void

Recursive method checks for circular loops in redirects list.

Описание методов

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

Checks if such redirect doesn't exists yet and creates new redirect entity.
public CreateRedirectEntity ( string pageUrl, string redirectUrl ) : Redirect
pageUrl string The page URL.
redirectUrl string The redirect URL.
Результат Redirect

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

Initializes a new instance of the DefaultRedirectService class.
public DefaultRedirectService ( IUnitOfWork unitOfWork, IUrlService urlService, IRepository repository ) : System
unitOfWork IUnitOfWork The unit of work.
urlService IUrlService The URL service.
repository IRepository The repository.
Результат System

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

public DeleteRedirect ( System.Guid id, int version ) : bool
id System.Guid
version int
Результат bool

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

Gets the list with all redirects.
public GetAllRedirects ( ) : IList
Результат IList

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

Gets redirect, if such redirect exists.
public GetPageRedirect ( string pageUrl, System.Guid id = null ) : Redirect
pageUrl string The page URL.
id System.Guid The redirect id.
Результат Redirect

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

Gets the redirect for given url.
public GetRedirect ( string url ) : string
url string The URL.
Результат string

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

public SaveRedirect ( ViewModels model, bool createIfNotExists = false ) : Redirect
model ViewModels
createIfNotExists bool
Результат Redirect

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

Validates urls: checks if the the circular loop exists.
public ValidateForCircularLoop ( string pageUrl, string redirectUrl, System.Guid id = null ) : void
pageUrl string The page URL.
redirectUrl string The redirect URL.
id System.Guid The id.
Результат void

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