Base solution for your next web application
Open Closed

Add IRepository Into Session #5552


User avatar
0
nikkariman025 created

Hi, I've encountered an issue with session when I joint with the table license into TenantManager. I managed to get the value that I needed(licenseTypeId) but the session itself cannot be stored when I login through swagger and logout as soon as I logged into web app. Any idea what is the issue and how to solve it? Here's my code:

if (AbpSession.TenantId.HasValue)
            {
                
                output.Tenant = ObjectMapper
                    .Map<TenantLoginInfoDto>(await TenantManager
                        .Tenants
                        .Include(t => t.Edition)
                        .FirstAsync(t => t.Id == AbpSession.GetTenantId()));

                var license = await _licenseRepository.GetAll()
                    .FirstAsync(a => a.TenantId == AbpSession.GetTenantId());

                output.Tenant.LicenseTypeId = license.LicenseTypeId;

                return output;

            }

Your guidance is much appreciated. Thank you.


1 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team

    Please share the full application service method code.