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>
This commit is contained in:
Bjarke Berg
2023-04-14 12:03:25 +02:00
committed by GitHub
parent d625fee1ad
commit 861b883d29
16 changed files with 82 additions and 68 deletions

View File

@@ -7,12 +7,12 @@ public interface IUserIdKeyResolver
/// </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);
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);
public Task<Guid> GetAsync(int id);
}