move user workload from siterouter to app component to improve performance and 404 handling

This commit is contained in:
sbwalker
2025-12-05 08:40:30 -05:00
parent 23d14c62a5
commit a51f87d743
12 changed files with 91 additions and 39 deletions

View File

@@ -1,6 +1,8 @@
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Xml.Linq;
namespace Oqtane.Models
{
@@ -128,5 +130,34 @@ namespace Oqtane.Models
/// </summary>
[NotMapped]
public Dictionary<string, string> Settings { get; set; }
public User Clone()
{
return new User
{
UserId = UserId,
Username = Username,
DisplayName = DisplayName,
Email = Email,
TimeZoneId = TimeZoneId,
PhotoFileId = PhotoFileId,
LastLoginOn = LastLoginOn,
LastIPAddress = LastIPAddress,
TwoFactorRequired = TwoFactorRequired,
TwoFactorCode = TwoFactorCode,
TwoFactorExpiry = TwoFactorExpiry,
SecurityStamp = SecurityStamp,
SiteId = SiteId,
Roles = Roles,
DeletedBy = DeletedBy,
DeletedOn = DeletedOn,
IsDeleted = IsDeleted,
Password = Password,
IsAuthenticated = IsAuthenticated,
EmailConfirmed = EmailConfirmed,
SuppressNotification = SuppressNotification,
Settings = Settings.ToDictionary(setting => setting.Key, setting => setting.Value)
};
}
}
}