using System;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using Abp.Domain.Entities;
using Abp.Domain.Entities.Auditing;
using Abp.Timing;
namespace IwbZero.Authorization.Users
{///
/// Used to save a login attempt of a user.
///
[Table("Sys_UserLoginLogs")]
public class UserLoginAttempt : Entity, IHasCreationTime
{
public const int MaxUserNameOrEmailAddressLength = 255;
///
/// Maximum length of property.
///
public const int MaxClientIpAddressLength = 64;
///
/// Maximum length of property.
///
public const int MaxClientNameLength = 128;
///
/// Maximum length of property.
///
public const int MaxBrowserInfoLength = 512;
///
/// User's Id, if was a valid username or email address.
///
public long? UserId { get; set; }
///
/// User name or email address
///
[MaxLength(MaxUserNameOrEmailAddressLength)]
public string UserNameOrEmailAddress { get; set; }
///
/// IP address of the client.
///
[MaxLength(MaxClientIpAddressLength)]
public string ClientIpAddress { get; set; }
///
/// Name (generally computer name) of the client.
///
[MaxLength(MaxClientNameLength)]
public string ClientName { get; set; }
///
/// Browser information if this method is called in a web request.
///
[MaxLength(MaxBrowserInfoLength)]
public string BrowserInfo { get; set; }
///
/// Login attempt result.
///
public AbpLoginResultType Result { get; set; }
public DateTime CreationTime { get; set; }
///
/// Initializes a new instance of the class.
///
public UserLoginAttempt()
{
CreationTime = Clock.Now;
}
}
}