.Net 5.0 Get User Email From Claims From searching online I have identified two ways to get the user email, but I don't know if either has pro's/con's beyond Option.1 being a larger number of lines of code?
Option.1
I have a dedicated ClaimsPrincipalExtension.cs class, which I can call from anywhere in my app using var email = ClaimsPrincipalExtensions.GetLoggedInUserEmail(User);. Within which I have a method to get the email as shown:
using System;
using System.Security.Claims; 
    
namespace FunctionalLogicLibrary { 
    
public static class ClaimsPrincipalExtensions { 
public static string GetLoggedInUserEmail(this ClaimsPrincipal principal) {
if (principal == null)
throw new ArgumentNullException(nameof(principal));
return principal.FindFirstValue(ClaimTypes.Email); }
 } 
}

Option.2
I just add using System.Security.Claims; to any class where I need it and use 
var email = User.FindFirstValue(ClaimTypes.Email);

I'm just trying to learn here. Which method is more appropriate and why?
I frequently write extension methods for IPrincipal and ClaimsPrincipal objects (depending on .NET framework version). Creating an abstraction for a business concept is a good idea, because it centralizes this knowledge (think: Single Source of Truth). If this happens to change in the future, you have one file, one method to modify. Option 1 is preferred, since it simplifies maintenance.
Some additional improvements:

Call extension methods from the object context: user.GetCurrentlyLoggedInUserEmail()
This is what extension methods are for. Take advantage of their syntactical sugar.

Do not duplicate concepts in the method name that already exist in the type it extends. This just makes method names too long for no added benefit: calling user.GetEmail() conveys the same information in a fraction of the characters.
Plus, &quot;LoggedIn&quot; is contextual, and assumes you are calling this on a ClaimsPrincipal that is the currently logged in user. This is not something the .NET type system enforces, so your method name should not make this assumption.