You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Dec 20, 2018. It is now read-only.
Why is the CancellationToken in UserManager private and not protected so it is available to derived class methods and properties?
public class Microsoft.AspNetCore.Identity.UserManager<TUser>
{
// why private?
private CancellationToken CancellationToken => _context?.RequestAborted ?? CancellationToken.None;
}
I have created a new class inheriting from UserManager and added a few new async methods that could make use of the cancellation token if only it was available.
example:
public class UserManager<TUser> : Microsoft.AspNetCore.Identity.UserManager<TUser> ...
{
...
// Retrieving custom firstname property from TUser
public async Task<string> GetFirstNameAsync(TUser user)
{
ThrowIfDisposed();
return await Store.GetFirstNameAsync(user, CancellationToken); // won't work because cancellation token is not available in UserManager
}
}
The text was updated successfully, but these errors were encountered:
Why is the CancellationToken in UserManager private and not protected so it is available to derived class methods and properties?
I have created a new class inheriting from UserManager and added a few new async methods that could make use of the cancellation token if only it was available.
example:
The text was updated successfully, but these errors were encountered: