using System; using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; using BlueWest.Data; using MapTo; using Microsoft.AspNetCore.Identity; namespace BlueWest.WebApi.Context.Users { /// /// Application User in the Identity System. /// [MapFrom(typeof(ApplicationUserUnique))] [UseUpdate] public partial class ApplicationUser : IdentityUser { /// /// Gets or sets the primary key for this user. /// [DatabaseGenerated(DatabaseGeneratedOption.Identity)] [PersonalData] public new string Id { get; set; } public List Users { get; set; } [ProtectedPersonalData] public override string UserName { get; set; } public override string NormalizedUserName { get; set; } [ProtectedPersonalData] public override string Email { get; set; } /// /// Gets or sets the normalized email address for this user. /// public override string NormalizedEmail { get; set; } /// /// Gets or sets a flag indicating if a user has confirmed their email address. /// /// True if the email address has been confirmed, otherwise false. [PersonalData] public override bool EmailConfirmed { get; set; } /// /// Gets or sets a salted and hashed representation of the password for this user. /// public override string PasswordHash { get; set; } /// /// A random value that must change whenever a users credentials change (password changed, login removed) /// public override string SecurityStamp { get; set; } /// /// A random value that must change whenever a user is persisted to the store /// public override string ConcurrencyStamp { get; set; } = Guid.NewGuid().ToString(); /// /// Gets or sets a telephone number for the user. /// [ProtectedPersonalData] public override string PhoneNumber { get; set; } /// /// Gets or sets a flag indicating if a user has confirmed their telephone address. /// /// True if the telephone number has been confirmed, otherwise false. [PersonalData] public override bool PhoneNumberConfirmed { get; set; } /// /// Gets or sets a flag indicating if two factor authentication is enabled for this user. /// /// True if 2fa is enabled, otherwise false. [PersonalData] public override bool TwoFactorEnabled { get; set; } /// /// Gets or sets the date and time, in UTC, when any user lockout ends. /// /// /// A value in the past means the user is not locked out. /// public override DateTimeOffset? LockoutEnd { get; set; } /// /// Gets or sets a flag indicating if the user could be locked out. /// /// True if the user could be locked out, otherwise false. public override bool LockoutEnabled { get; set; } /// /// Gets or sets the number of failed login attempts for the current user. /// public override int AccessFailedCount { get; set; } } }