Microsoft.AspNetCore.Identity UserManager GetUserAsync
问题 I've been reading the source code of UserManager.cs and I've stepped into the following block: public virtual Task<TUser> GetUserAsync(ClaimsPrincipal principal) { if (principal == null) { throw new ArgumentNullException(nameof(principal)); } var id = GetUserId(principal); return id == null ? Task.FromResult<TUser>(null) : FindByIdAsync(id); } I've been very curious if there is a reason why the above is not like this: public virtual async Task<TUser> GetUserAsync(ClaimsPrincipal principal) {