Interface IUserIdKeyResolver
Namespace: Umbraco.Cms.Core.Services
Assembly: Umbraco.Core.dll
Syntax
public interface IUserIdKeyResolver
Methods
View SourceGetAsync(Guid)
Tries to resolve a user key to a user id without fetching the entire user.
Declaration
Task<int> GetAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The key of the user. |
Returns
| Type | Description |
|---|---|
| Task<int> | The id of the user. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when no user was found with the specified key. |
GetAsync(int)
Tries to resolve a user id to a user key without fetching the entire user.
Declaration
Task<Guid> GetAsync(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The id of the user. |
Returns
| Type | Description |
|---|---|
| Task<Guid> | The key of the user. |
Exceptions
| Type | Condition |
|---|---|
| InvalidOperationException | Thrown when no user was found with the specified id. |
TryGetAsync(Guid)
Tries to resolve a user key to a user id without fetching the entire user.
Declaration
Task<Attempt<int>> TryGetAsync(Guid key)
Parameters
| Type | Name | Description |
|---|---|---|
| Guid | key | The key of the user. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<int>> | An attempt with the id of the user. |
TryGetAsync(int)
Tries to resolve a user id to a user key without fetching the entire user.
Declaration
Task<Attempt<Guid>> TryGetAsync(int id)
Parameters
| Type | Name | Description |
|---|---|---|
| int | id | The id of the user. |
Returns
| Type | Description |
|---|---|
| Task<Attempt<Guid>> | An attempt with the key of the user. |