NullIwbSession.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using System.Collections.Generic;
  2. using System.Security.Claims;
  3. using Abp.MultiTenancy;
  4. using Abp.Runtime.Remoting;
  5. using Abp.Runtime.Session;
  6. namespace IwbZero.Runtime.Session
  7. {
  8. public sealed class NullIwbSession : AbpSessionBase, IIwbSession
  9. {
  10. public NullIwbSession() : base(
  11. null,
  12. new DataContextAmbientScopeProvider<SessionOverride>(new AsyncLocalAmbientDataContext())
  13. )
  14. {
  15. }
  16. public string UserName => null;
  17. public string PhoneNumber => null;
  18. public string RealName => null;
  19. public string EmailAddress => null;
  20. public string AccountNo => null;
  21. public string AvatarImagePath => null;
  22. public int? UserType => null;
  23. public int? AccountType => null;
  24. public List<string> UserRoles => null;
  25. public List<string> UserRoleIds => null;
  26. public Claim GetClaim(string type)
  27. {
  28. return null;
  29. }
  30. public static NullIwbSession Instance { get; } = new NullIwbSession();
  31. /// <inheritdoc/>
  32. public override long? UserId => null;
  33. /// <inheritdoc/>
  34. public override int? TenantId => null;
  35. public override MultiTenancySides MultiTenancySide => MultiTenancySides.Tenant;
  36. public override long? ImpersonatorUserId => null;
  37. public override int? ImpersonatorTenantId => null;
  38. }
  39. }