C# Class BetterCms.Module.Pages.Services.DefaultRedirectService

Inheritance: IRedirectService
Afficher le fichier Open project: devbridge/BetterCMS

Méthodes publiques

Méthode Description
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.

Private Methods

Méthode Description
RecursiveCircularLoop ( IList redirects, string redirectUrl, List checkedIds, string startPageUrl, string startRedirectUrl ) : void

Recursive method checks for circular loops in redirects list.

Method Details

CreateRedirectEntity() public méthode

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.
Résultat Redirect

DefaultRedirectService() public méthode

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.
Résultat System

DeleteRedirect() public méthode

public DeleteRedirect ( System.Guid id, int version ) : bool
id System.Guid
version int
Résultat bool

GetAllRedirects() public méthode

Gets the list with all redirects.
public GetAllRedirects ( ) : IList
Résultat IList

GetPageRedirect() public méthode

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.
Résultat Redirect

GetRedirect() public méthode

Gets the redirect for given url.
public GetRedirect ( string url ) : string
url string The URL.
Résultat string

SaveRedirect() public méthode

public SaveRedirect ( ViewModels model, bool createIfNotExists = false ) : Redirect
model ViewModels
createIfNotExists bool
Résultat Redirect

ValidateForCircularLoop() public méthode

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.
Résultat void

ValidateRedirectExists() public méthode

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.
Résultat void