public static Guid GetContactId(this IPrincipal principal)
 {
     return(string.IsNullOrEmpty(principal?.Identity?.Name)
         ? GetAnonymousUserId()
         : principal.GetCustomerContact().PrimaryKeyId.Value);
 }