Interface IRedirectUrlRepository
Defines the IRedirectUrl repository.
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface IRedirectUrlRepository : IReadWriteQueryRepository<Guid, IRedirectUrl>, IReadRepository<Guid, IRedirectUrl>, IWriteRepository<IRedirectUrl>, IQueryRepository<IRedirectUrl>, IRepository
Methods
View SourceDelete(Guid)
Deletes a redirect URL.
Declaration
void Delete(Guid id)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | id | The redirect URL identifier. |
DeleteAll()
Deletes all redirect URLs.
Declaration
void DeleteAll()
DeleteContentUrls(Guid)
Deletes all redirect URLs for a given content.
Declaration
void DeleteContentUrls(Guid contentKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | contentKey | The content unique key. |
Get(string, Guid, string?)
Gets a redirect URL.
Declaration
IRedirectUrl? Get(string url, Guid contentKey, string? culture)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The Umbraco redirect URL route. |
| Guid | contentKey | The content unique key. |
| string | culture | The culture. |
Returns
| Type | Description |
|---|---|
| IRedirectUrl |
GetAllUrls(int, long, int, out long)
Gets all redirect URLs below a given content item.
Declaration
IEnumerable<IRedirectUrl> GetAllUrls(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. |
GetAllUrls(long, int, out long)
Gets all redirect URLs.
Declaration
IEnumerable<IRedirectUrl> GetAllUrls(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. |
GetContentUrls(Guid)
Gets all redirect URLs for a content item.
Declaration
IEnumerable<IRedirectUrl> GetContentUrls(Guid contentKey)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | contentKey | The content unique key. |
Returns
| Type | Description |
|---|---|
| IEnumerable<IRedirectUrl> | All redirect URLs for the content item. |
GetMostRecentUrl(string)
Gets the most recent redirect URL corresponding to an Umbraco redirect URL route.
Declaration
IRedirectUrl? GetMostRecentUrl(string url)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The Umbraco redirect URL route. |
Returns
| Type | Description |
|---|---|
| IRedirectUrl | The most recent redirect URL corresponding to the route. |
GetMostRecentUrl(string, string)
Gets the most recent redirect URL corresponding to an Umbraco redirect URL route.
Declaration
IRedirectUrl? GetMostRecentUrl(string url, string culture)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The Umbraco redirect URL route. |
| string | culture | The culture the domain is associated with |
Returns
| Type | Description |
|---|---|
| IRedirectUrl | The most recent redirect URL corresponding to the route. |
GetMostRecentUrlAsync(string)
Gets the most recent redirect URL corresponding to an Umbraco redirect URL route.
Declaration
Task<IRedirectUrl?> GetMostRecentUrlAsync(string url)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The Umbraco redirect URL route. |
Returns
| Type | Description |
|---|---|
| Task<IRedirectUrl> | The most recent redirect URL corresponding to the route. |
GetMostRecentUrlAsync(string, string)
Gets the most recent redirect URL corresponding to an Umbraco redirect URL route.
Declaration
Task<IRedirectUrl?> GetMostRecentUrlAsync(string url, string culture)
Parameters
| Type | Name | Description |
|---|---|---|
| string | url | The Umbraco redirect URL route. |
| string | culture | The culture the domain is associated with |
Returns
| Type | Description |
|---|---|
| Task<IRedirectUrl> | The most recent redirect URL corresponding to the route. |
SearchUrls(string, long, int, out long)
Searches for all redirect URLs that contain a given search term in their URL property.
Declaration
IEnumerable<IRedirectUrl> SearchUrls(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. |