UserLogin.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System.ComponentModel.DataAnnotations;
  2. using System.ComponentModel.DataAnnotations.Schema;
  3. using Abp.Domain.Entities;
  4. namespace IwbZero.Authorization.Users
  5. {
  6. [Table("Sys_UserLogins")]
  7. public class UserLogin : Entity<long>
  8. {
  9. /// <summary>
  10. /// Maximum length of <see cref="LoginProvider"/> property.
  11. /// </summary>
  12. public const int MaxLoginProviderLength = 128;
  13. /// <summary>
  14. /// Maximum length of <see cref="ProviderKey"/> property.
  15. /// </summary>
  16. public const int MaxProviderKeyLength = 256;
  17. //public virtual int? TenantId { get; set; }
  18. /// <summary>
  19. /// Id of the User.
  20. /// </summary>
  21. public virtual long UserId { get; set; }
  22. /// <summary>
  23. /// Login Provider.
  24. /// </summary>
  25. [Required]
  26. [MaxLength(MaxLoginProviderLength)]
  27. public virtual string LoginProvider { get; set; }
  28. /// <summary>
  29. /// Key in the <see cref="LoginProvider"/>.
  30. /// </summary>
  31. [Required]
  32. [MaxLength(MaxProviderKeyLength)]
  33. public virtual string ProviderKey { get; set; }
  34. public UserLogin()
  35. {
  36. }
  37. public UserLogin(long userId, string loginProvider, string providerKey)
  38. {
  39. UserId = userId;
  40. LoginProvider = loginProvider;
  41. ProviderKey = providerKey;
  42. }
  43. }
  44. }