Activities of "maliming"

hi

Yes, You have to enable the Redis.

https://support.abp.io/QA/Questions/6533/Why-do-I-need-the-Redis-cache-for-the-public-website#answer-3a10363f-48d7-73fe-88fc-51114ebe105d

hi

I confirmed. You have to use Redis in tiered projects. otherwise, you may get some strange problems.

but you can try the code below:

host/TestApplicationNet8.Web.Host/MyMvcRemoteTenantStore.cs

using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
using Pages.Abp.MultiTenancy.ClientProxies;
using Volo.Abp.AspNetCore.Mvc.Client;
using Volo.Abp.Caching;
using Volo.Abp.DependencyInjection;
using Volo.Abp.MultiTenancy;
using Volo.Abp.Threading;

namespace TestApplicationNet8;

[ExposeServices(typeof(ITenantStore))]
public class MyMvcRemoteTenantStore :  ITenantStore, ITransientDependency
{
    protected AbpTenantClientProxy TenantAppService { get; }
    protected IHttpContextAccessor HttpContextAccessor { get; }
    protected IDistributedCache<TenantConfigurationCacheItem> Cache { get; }
    protected AbpAspNetCoreMvcClientCacheOptions Options { get; }

    public MyMvcRemoteTenantStore(
        AbpTenantClientProxy tenantAppService,
        IHttpContextAccessor httpContextAccessor,
        IDistributedCache<TenantConfigurationCacheItem> cache,
        IOptions<AbpAspNetCoreMvcClientCacheOptions> options)
    {
        TenantAppService = tenantAppService;
        HttpContextAccessor = httpContextAccessor;
        Cache = cache;
        Options = options.Value;
    }

    public async Task<TenantConfiguration?> FindAsync(string normalizedName)
    {
        var cacheKey = TenantConfigurationCacheItem.CalculateCacheKey(normalizedName);
        var httpContext = HttpContextAccessor?.HttpContext;

        if (httpContext != null && httpContext.Items[cacheKey] is TenantConfigurationCacheItem tenantConfigurationInHttpContext)
        {
            return tenantConfigurationInHttpContext?.Value;
        }

        var tenantConfiguration = await Cache.GetAsync(cacheKey);
        if (tenantConfiguration?.Value == null)
        {
            var tenant = await TenantAppService.FindTenantByNameAsync(normalizedName);
            if (tenant.Success)
            {
                tenantConfiguration = new TenantConfigurationCacheItem(new TenantConfiguration(tenant.TenantId!.Value, tenant.NormalizedName!));
                await Cache.SetAsync(cacheKey, tenantConfiguration);
            }
        }

        if (httpContext != null)
        {
            httpContext.Items[cacheKey] = tenantConfiguration;
        }

        return tenantConfiguration?.Value;
    }

    public async Task<TenantConfiguration?> FindAsync(Guid id)
    {
        var cacheKey = TenantConfigurationCacheItem.CalculateCacheKey(id);
        var httpContext = HttpContextAccessor?.HttpContext;

        if (httpContext != null && httpContext.Items[cacheKey] is TenantConfigurationCacheItem tenantConfigurationInHttpContext)
        {
            return tenantConfigurationInHttpContext?.Value;
        }

        var tenantConfiguration = await Cache.GetAsync(cacheKey);
        if (tenantConfiguration?.Value == null)
        {
            var tenant = await TenantAppService.FindTenantByIdAsync(id);
            if (tenant.Success)
            {
                tenantConfiguration = new TenantConfigurationCacheItem(new TenantConfiguration(tenant.TenantId!.Value, tenant.NormalizedName!));
                await Cache.SetAsync(cacheKey, tenantConfiguration);
            }
        }

        if (httpContext != null)
        {
            httpContext.Items[cacheKey] = tenantConfiguration;
        }

        return tenantConfiguration?.Value;
    }

    public Task<IReadOnlyList<TenantConfiguration>> GetListAsync(bool includeDetails = false)
    {
        return Task.FromResult<IReadOnlyList<TenantConfiguration>>(Array.Empty<TenantConfiguration>());
    }

    public TenantConfiguration? Find(string normalizedName)
    {
        var cacheKey = TenantConfigurationCacheItem.CalculateCacheKey(normalizedName);
        var httpContext = HttpContextAccessor?.HttpContext;

        if (httpContext != null && httpContext.Items[cacheKey] is TenantConfigurationCacheItem tenantConfigurationInHttpContext)
        {
            return tenantConfigurationInHttpContext?.Value;
        }

        var tenantConfiguration = Cache.Get(cacheKey);
        if (tenantConfiguration?.Value == null)
        {
            var tenant = AsyncHelper.RunSync(async () => await TenantAppService.FindTenantByNameAsync(normalizedName));
            if (tenant.Success)
            {
                tenantConfiguration = new TenantConfigurationCacheItem(new TenantConfiguration(tenant.TenantId!.Value, tenant.NormalizedName!));
                Cache.Set(cacheKey, tenantConfiguration);
            }
        }

        if (httpContext != null)
        {
            httpContext.Items[cacheKey] = tenantConfiguration;
        }

        return tenantConfiguration?.Value;
    }

    public TenantConfiguration? Find(Guid id)
    {
        var cacheKey = TenantConfigurationCacheItem.CalculateCacheKey(id);
        var httpContext = HttpContextAccessor?.HttpContext;

        if (httpContext != null && httpContext.Items[cacheKey] is TenantConfigurationCacheItem tenantConfigurationInHttpContext)
        {
            return tenantConfigurationInHttpContext?.Value;
        }

        var tenantConfiguration = Cache.Get(cacheKey);
        if (tenantConfiguration?.Value == null)
        {
            var tenant = AsyncHelper.RunSync(async () => await TenantAppService.FindTenantByIdAsync(id));
            if (tenant.Success)
            {
                tenantConfiguration = new TenantConfigurationCacheItem(new TenantConfiguration(tenant.TenantId!.Value, tenant.NormalizedName!));
                Cache.Set(cacheKey, tenantConfiguration);
            }
        }

        if (httpContext != null)
        {
            httpContext.Items[cacheKey] = tenantConfiguration;
        }

        return tenantConfiguration?.Value;
    }
}

Yes. Azure is used store file. The FM module is used to store file/folder info.

hi

When I open the File Management UI page. I am expecting the folders & files should come from my Azure container.

This is by design. Only file/blob will be stored on Azure. The file and folder info will be stored in the FM database.

hi

You should add it to ConfigureServices method of APIHost project

Your code seems no problem.

Can you share a simple project? liming.ma@volosoft.com

hi

Login with this tenant and get the exception

What projects of host are you running?

hi

Create a module project on abp suite

Can you share this project via https://wetransfer.com/

liming.ma@volosoft.com

Thanks

hi

. But after following all the steps based on your document, it is still using the database only.

Please share your configuration code.

Great.

Showing 4941 to 4950 of 11568 entries
Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.1.0-preview. Updated on December 25, 2025, 06:16
1
ABP Assistant
🔐 You need to be logged in to use the chatbot. Please log in first.