Interface IRedirectUrlService
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IRedirectUrlService : IService
Methods
View SourceDelete(Guid)
Deletes a redirect URL.
Declaration
void Delete(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The redirect URL identifier. |
Delete(IRedirectUrl)
Deletes a redirect URL.
Declaration
void Delete(IRedirectUrl redirectUrl)
Parameters
| Type | Name | Description |
|---|---|---|
| IRedirectUrl | redirectUrl | The redirect URL to delete. |
DeleteAll()
Deletes all redirect URLs.
Declaration
void DeleteAll()
DeleteContentRedirectUrls(Guid)
Deletes all redirect URLs for a given content.
Declaration
void DeleteContentRedirectUrls(Guid contentKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | contentKey | The content unique key. |
GetAllRedirectUrls(int, int, out long)
Gets all redirect URLs.
Declaration
IEnumerable<IRedirectUrl> GetAllRedirectUrls(int skip, int take, out long total)
Parameters
| Type | Name | Description |
|---|---|---|
| int | skip | Amount to skip. |
| int | take | Amount to take. |
| long | total | The total count of redirect URLs. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IRedirectUrl> | The redirect URLs. |
GetAllRedirectUrls(int, long, int, out long)
Gets all redirect URLs below a given content item.
Declaration
IEnumerable<IRedirectUrl> GetAllRedirectUrls(int rootContentId, long pageIndex, int pageSize, out long total)
Parameters
| Type | Name | Description |
|---|---|---|
| int | rootContentId | The content unique identifier. |
| long | pageIndex | The page index. |
| int | pageSize | The page size. |
| long | total | The total count of redirect URLs. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IRedirectUrl> | The redirect URLs. |
GetAllRedirectUrls(long, int, out long)
Gets all redirect URLs.
Declaration
IEnumerable<IRedirectUrl> GetAllRedirectUrls(long pageIndex, int pageSize, out long total)
Parameters
| Type | Name | Description |
|---|---|---|
| long | pageIndex | The page index. |
| int | pageSize | The page size. |
| long | total | The total count of redirect URLs. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IRedirectUrl> | The redirect URLs. |
GetContentRedirectUrls(Guid)
Gets all redirect URLs for a content item.
Declaration
IEnumerable<IRedirectUrl> GetContentRedirectUrls(Guid contentKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | contentKey | The content unique key. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IRedirectUrl> | All redirect URLs for the content item. |
GetMostRecentRedirectUrl(string)
Gets the most recent redirect URLs corresponding to an Umbraco redirect URL route.
Declaration
IRedirectUrl? GetMostRecentRedirectUrl(string url)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The Umbraco redirect URL route. |
Returns
| Type | Description |
|---|---|
| IRedirectUrl | The most recent redirect URLs corresponding to the route. |
GetMostRecentRedirectUrl(string, string?)
Gets the most recent redirect URLs corresponding to an Umbraco redirect URL route.
Declaration
IRedirectUrl? GetMostRecentRedirectUrl(string url, string? culture)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The Umbraco redirect URL route. |
| string | culture | The culture of the request. |
Returns
| Type | Description |
|---|---|
| IRedirectUrl | The most recent redirect URLs corresponding to the route. |
GetMostRecentRedirectUrlAsync(string, string?)
Gets the most recent redirect URLs corresponding to an Umbraco redirect URL route.
Declaration
Task<IRedirectUrl?> GetMostRecentRedirectUrlAsync(string url, string? culture)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The Umbraco redirect URL route. |
| string | culture | The culture of the request. |
Returns
| Type | Description |
|---|---|
| Task<IRedirectUrl> | The most recent redirect URLs corresponding to the route. |
Register(string, Guid, string?)
Registers a redirect URL.
Declaration
void Register(string url, Guid contentKey, string? culture = null)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The Umbraco URL route. |
| Guid | contentKey | The content unique key. |
| string | culture | The culture. |
Remarks
Is a proper Umbraco route eg /path/to/foo or 123/path/tofoo.
SearchRedirectUrls(string, int, int, out long)
Searches for all redirect URLs that contain a given search term in their URL property.
Declaration
IEnumerable<IRedirectUrl> SearchRedirectUrls(string searchTerm, int skip, int take, out long total)
Parameters
| Type | Name | Description |
|---|---|---|
| string | searchTerm | The term to search for. |
| int | skip | Amount to skip. |
| int | take | Amount to take. |
| long | total | The total count of redirect URLs. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IRedirectUrl> | The redirect URLs. |
SearchRedirectUrls(string, long, int, out long)
Searches for all redirect URLs that contain a given search term in their URL property.
Declaration
IEnumerable<IRedirectUrl> SearchRedirectUrls(string searchTerm, long pageIndex, int pageSize, out long total)
Parameters
| Type | Name | Description |
|---|---|---|
| string | searchTerm | The term to search for. |
| long | pageIndex | The page index. |
| int | pageSize | The page size. |
| long | total | The total count of redirect URLs. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IRedirectUrl> | The redirect URLs. |