Interface ILanguageRepository
Namespace: Umbraco.Cms.Core.Persistence.Repositories
Assembly: Umbraco.Core.dll
Syntax
public interface ILanguageRepository : IReadWriteQueryRepository<int, ILanguage>, IReadRepository<int, ILanguage>, IWriteRepository<ILanguage>, IQueryRepository<ILanguage>, IRepository
Methods
View SourceGetByIsoCode(string)
Declaration
ILanguage? GetByIsoCode(string isoCode)
Parameters
| Type | Name | Description |
|---|---|---|
| string | isoCode |
Returns
| Type | Description |
|---|---|
| ILanguage |
GetDefaultId()
Gets the default language identifier.
Declaration
int? GetDefaultId()
Returns
| Type | Description |
|---|---|
| int? |
Remarks
This can be optimized and bypass all deep cloning.
GetDefaultIsoCode()
Gets the default language ISO code.
Declaration
string GetDefaultIsoCode()
Returns
| Type | Description |
|---|---|
| string |
Remarks
This can be optimized and bypass all deep cloning.
GetIdByIsoCode(string?, bool)
Gets a language identifier from its ISO code.
Declaration
int? GetIdByIsoCode(string? isoCode, bool throwOnNotFound = true)
Parameters
| Type | Name | Description |
|---|---|---|
| string | isoCode | |
| bool | throwOnNotFound |
Returns
| Type | Description |
|---|---|
| int? |
Remarks
This can be optimized and bypass all deep cloning.
GetIsoCodeById(int?, bool)
Gets a language ISO code from its identifier.
Declaration
string? GetIsoCodeById(int? id, bool throwOnNotFound = true)
Parameters
| Type | Name | Description |
|---|---|---|
| int? | id | |
| bool | throwOnNotFound |
Returns
| Type | Description |
|---|---|
| string |
Remarks
This can be optimized and bypass all deep cloning.
GetIsoCodesByIds(ICollection<int>, bool)
Gets multiple language ISO codes from the provided Ids.
Declaration
string[] GetIsoCodesByIds(ICollection<int> ids, bool throwOnNotFound = true)
Parameters
| Type | Name | Description |
|---|---|---|
| ICollection<int> | ids | The language Ids. |
| bool | throwOnNotFound | Indicates whether to throw an exception if the provided Id is not found as a language. |
Returns
| Type | Description |
|---|---|
| string[] |