Open Closed

How to set the tenant while using the dynamic C# API client proxies on WPF application? #4236


User avatar
0
uyarbtrlp created

Hello,

We've created a WPF application that uses the dynamic C# API client proxies. It consumes the HttpApi.Client module of our project. We basically want to set the tenant name while the request is being sent to do operations according to the tenant and expect it from the users with an input field. How can I set the tenant name while using the dynamic C# API client proxies?

  • ABP Framework version: v5.3.3
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC): yes
  • Exception message and stack trace:
  • Steps to reproduce the issue:"

3 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    How can I set the tenant name while using the dynamic C# API client proxies?

    You can change the current tenant

    using (_currentTenant.Change(tenantId))
    {
        return await _dynamicProductService.GetListAsync();
    }
    
    
  • User Avatar
    0
    uyarbtrlp created

    Is there a way to do it with the tenant name like passing the __tenant value in the header values?

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    No, It will set Tenant.Id by default.

    https://github.com/abpframework/abp/blob/dev/framework/src/Volo.Abp.Http.Client/Volo/Abp/Http/Client/ClientProxying/ClientProxyBase.cs#L296

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11