Refactor EGUser construction and add extension method
Removed constructors from EGUser class and introduced a new static class EGUserExtensions with a ToEGUser extension method to facilitate the conversion from User to EGUser. Updated namespace imports to include DigitalData.UserManager.Domain.Entities.
This commit is contained in:
@@ -6,30 +6,6 @@ namespace EnvelopeGenerator.Domain.Entities
|
||||
[Table("TBDD_USER", Schema = "dbo")]
|
||||
public class EGUser : User
|
||||
{
|
||||
public EGUser()
|
||||
{
|
||||
}
|
||||
|
||||
public EGUser(User user)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
#region FORM_APP
|
||||
[NotMapped]
|
||||
public bool HasAccess { get; set; }
|
||||
|
||||
30
EnvelopeGenerator.Domain/Entities/EGUserExtensions.cs
Normal file
30
EnvelopeGenerator.Domain/Entities/EGUserExtensions.cs
Normal file
@@ -0,0 +1,30 @@
|
||||
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
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user