2017-11-25 19:29:58 -06:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections.Generic;
|
|
|
|
|
using System.ComponentModel.DataAnnotations;
|
|
|
|
|
using System.ComponentModel.DataAnnotations.Schema;
|
|
|
|
|
|
2018-04-08 01:44:42 -05:00
|
|
|
|
namespace SharedLibraryCore.Database.Models
|
2017-11-25 19:29:58 -06:00
|
|
|
|
{
|
2018-11-05 21:01:29 -06:00
|
|
|
|
public partial class EFClient : SharedEntity
|
2017-11-25 19:29:58 -06:00
|
|
|
|
{
|
|
|
|
|
[Key]
|
|
|
|
|
public int ClientId { get; set; }
|
2018-02-10 22:33:42 -06:00
|
|
|
|
public long NetworkId { get; set; }
|
2017-11-25 19:29:58 -06:00
|
|
|
|
[Required]
|
|
|
|
|
public int Connections { get; set; }
|
|
|
|
|
[Required]
|
2018-02-08 01:23:45 -06:00
|
|
|
|
// in seconds
|
2017-11-25 19:29:58 -06:00
|
|
|
|
public int TotalConnectionTime { get; set; }
|
|
|
|
|
[Required]
|
|
|
|
|
public DateTime FirstConnection { get; set; }
|
|
|
|
|
[Required]
|
|
|
|
|
public DateTime LastConnection { get; set; }
|
|
|
|
|
public bool Masked { get; set; }
|
|
|
|
|
[Required]
|
|
|
|
|
public int AliasLinkId { get; set; }
|
|
|
|
|
[ForeignKey("AliasLinkId")]
|
|
|
|
|
public virtual EFAliasLink AliasLink { get; set; }
|
2017-11-29 18:35:50 -06:00
|
|
|
|
[Required]
|
2018-11-05 21:01:29 -06:00
|
|
|
|
public Permission Level { get; set; }
|
2017-11-29 18:35:50 -06:00
|
|
|
|
|
|
|
|
|
[Required]
|
|
|
|
|
public int CurrentAliasId { get; set; }
|
|
|
|
|
[ForeignKey("CurrentAliasId")]
|
|
|
|
|
public virtual EFAlias CurrentAlias { get; set; }
|
|
|
|
|
|
2018-04-04 14:38:34 -05:00
|
|
|
|
public string Password { get; set; }
|
|
|
|
|
public string PasswordSalt { get; set; }
|
2018-06-01 23:48:10 -05:00
|
|
|
|
// list of meta for the client
|
|
|
|
|
public virtual ICollection<EFMeta> Meta { get; set; }
|
2018-04-04 14:38:34 -05:00
|
|
|
|
|
2017-11-29 18:35:50 -06:00
|
|
|
|
[NotMapped]
|
|
|
|
|
public virtual string Name
|
|
|
|
|
{
|
|
|
|
|
get { return CurrentAlias.Name; }
|
2018-11-07 20:30:11 -06:00
|
|
|
|
set { CurrentAlias.Name = value; }
|
2017-11-29 18:35:50 -06:00
|
|
|
|
}
|
|
|
|
|
[NotMapped]
|
2018-11-25 20:00:36 -06:00
|
|
|
|
public virtual int? IPAddress
|
2017-11-29 18:35:50 -06:00
|
|
|
|
{
|
|
|
|
|
get { return CurrentAlias.IPAddress; }
|
2018-11-07 20:30:11 -06:00
|
|
|
|
set { CurrentAlias.IPAddress = value; }
|
2017-11-29 18:35:50 -06:00
|
|
|
|
}
|
|
|
|
|
|
2018-02-10 22:33:42 -06:00
|
|
|
|
[NotMapped]
|
2018-11-25 20:00:36 -06:00
|
|
|
|
public string IPAddressString => IPAddress.ConvertIPtoString();
|
2018-05-14 12:55:10 -05:00
|
|
|
|
[NotMapped]
|
|
|
|
|
public virtual IDictionary<int, long> LinkedAccounts { get; set; }
|
2018-02-10 22:33:42 -06:00
|
|
|
|
|
2017-11-25 19:29:58 -06:00
|
|
|
|
public virtual ICollection<EFPenalty> ReceivedPenalties { get; set; }
|
|
|
|
|
public virtual ICollection<EFPenalty> AdministeredPenalties { get; set; }
|
|
|
|
|
}
|
|
|
|
|
}
|