TekH 07381e78b4 Refactor name retrieval to use GetFullName method
Updated the `CertificateModel.vb` and `EmailData.vb` files to replace direct access to the `FullName` property with the `GetFullName()` method for retrieving creator, sender, and receiver names. This change enhances flexibility and maintains consistency across the codebase.

Additionally, added a new static `GetFullName` method in the `EGUserExtensions.cs` file to centralize the formatting of user names by concatenating the `Prename` and `Name` properties.
2025-06-26 16:46:55 +02:00

32 lines
1.0 KiB
C#

using DigitalData.UserManager.Domain.Entities;
namespace EnvelopeGenerator.Domain.Entities
{
public static class EGUserExtensions
{
public static EGUser ToEGUser(this User user)
{
return new EGUser()
{
Id = user.Id,
Prename = user.Prename,
Name = user.Name,
Username = user.Username,
Shortname = user.Shortname,
Email = user.Email,
Language = user.Language,
Comment = user.Comment,
Deleted = user.Deleted,
DateFormat = user.DateFormat,
Active = user.Active,
GeneralViewer = user.GeneralViewer,
WanEnvironment = user.WanEnvironment,
UserIdFkIntEcm = user.UserIdFkIntEcm,
DeletedWhen = user.DeletedWhen,
DeletedWho = user.DeletedWho
};
}
public static string GetFullName(this User user) => $"{user.Prename} {user.Name}";
}
}