using System; using System.ComponentModel.DataAnnotations; using Abp.Domain.Entities.Auditing; using IwbZero.Authorization.Base.Users; using Microsoft.AspNet.Identity; namespace IwbZero.Authorization.Users { /// /// Represents a user. /// public abstract class IwbSysUser : UserBase, IUser, IFullAudited where TUser : IwbSysUser { /// /// Maximum length of the property. /// public const int MaxConcurrencyStampLength = 128; /// /// User name. /// User name must be unique for it's tenant. /// [Required] [StringLength(MaxUserNameLength)] public virtual string NormalizedUserName { get; set; } /// /// Email address of the user. /// Email address must be unique for it's tenant. /// [Required] [StringLength(MaxEmailAddressLength)] public virtual string NormalizedEmailAddress { get; set; } /// /// A random value that must change whenever a user is persisted to the store /// [StringLength(MaxConcurrencyStampLength)] public virtual string ConcurrencyStamp { get; set; } = Guid.NewGuid().ToString(); // public virtual ICollection Tokens { get; set; } public virtual TUser DeleterUser { get; set; } public virtual TUser CreatorUser { get; set; } public virtual TUser LastModifierUser { get; set; } public virtual void SetNormalizedNames() { NormalizedUserName = UserName?.ToUpperInvariant(); NormalizedEmailAddress = EmailAddress?.ToUpperInvariant(); } } }