Esempio n. 1
0
        protected virtual async Task FillTenantId(IVQSessionService _vQSessionService, IEnumerable <Claim> claims, ResourceExecutingContext context)
        {
            var tenantKey = claims.FirstOrDefault(x => x.Type == CLAIM_TENANT_KEY)?.Value;

            if (string.IsNullOrWhiteSpace(tenantKey))
            {
                throw new KeyNotFoundException();
            }

            var id = await _tenantEntityRepository.GetIdByKey(tenantKey, context.HttpContext.RequestAborted);

            _vQSessionService.TenantId = id;
        }
Esempio n. 2
0
 protected virtual Task FillOtherData(IVQSessionService _vQSessionService, IEnumerable <Claim> claims, ResourceExecutingContext context)
 {
     return(Task.CompletedTask);
 }
Esempio n. 3
0
 public VQTenantIdentifierFilter(IVQSessionService vQSessionService, IVQRepositoryWithoutTenant <T> tenantEntityRepository)
 {
     _vQSessionService       = vQSessionService;
     _tenantEntityRepository = tenantEntityRepository;
 }
Esempio n. 4
0
 public VQRepository(DbContext dbContext, IVQSessionService sessionService) : base(dbContext)
 {
     _sessionService = sessionService;
 }