Files
Umbraco-CMS/src/Umbraco.Core/Services/IUserIdKeyResolver.cs
Bjarke Berg 861b883d29 Throw from IUserIdKeyResolver if id/key not found. (#14101)
* Throw from IUserIdKeyResolver if id/key not found. This is too critical to not throw.

* Fixed tests

* Explicitly test that we can resolve super user key/ID from their counterparts

---------

Co-authored-by: kjac <kja@umbraco.dk>
2023-04-14 12:03:25 +02:00

19 lines
672 B
C#

namespace Umbraco.Cms.Core.Services;
public interface IUserIdKeyResolver
{
/// <summary>
/// Tries to resolve a user key to a user id without fetching the entire user.
/// </summary>
/// <param name="key">The key of the user. </param>
/// <returns>The id of the user, null if the user doesn't exist.</returns>
public Task<int> GetAsync(Guid key);
/// <summary>
/// Tries to resolve a user id to a user key without fetching the entire user.
/// </summary>
/// <param name="id">The id of the user. </param>
/// <returns>The key of the user, null if the user doesn't exist.</returns>
public Task<Guid> GetAsync(int id);
}