Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TenantStore list method added #19208

Merged
merged 3 commits into from
Mar 8, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.Extensions.Caching.Distributed;
using Pages.Abp.MultiTenancy.ClientProxies;
Expand Down Expand Up @@ -57,6 +58,11 @@ public MauiBlazorRemoteTenantStore(AbpTenantClientProxy tenantAppService, IDistr
return tenantConfiguration;
}

public Task<IReadOnlyList<TenantConfiguration>> GetListAsync(bool includeDetails = false)
{
ahmetfarukulu marked this conversation as resolved.
Show resolved Hide resolved
return Task.FromResult<IReadOnlyList<TenantConfiguration>>(Array.Empty<TenantConfiguration>());
}

public TenantConfiguration? Find(string normalizedName)
{
var cacheKey = CreateCacheKey(normalizedName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Http;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -79,6 +80,11 @@ public MvcRemoteTenantStore(
return tenantConfiguration?.Value;
}

public Task<IReadOnlyList<TenantConfiguration>> GetListAsync(bool includeDetails = false)
{
ahmetfarukulu marked this conversation as resolved.
Show resolved Hide resolved
return Task.FromResult<IReadOnlyList<TenantConfiguration>>(Array.Empty<TenantConfiguration>());
}

public TenantConfiguration? Find(string normalizedName)
{
var cacheKey = TenantConfigurationCacheItem.CalculateCacheKey(normalizedName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;

namespace Volo.Abp.MultiTenancy;
Expand All @@ -9,6 +10,8 @@ public interface ITenantStore

Task<TenantConfiguration?> FindAsync(Guid id);

Task<IReadOnlyList<TenantConfiguration>> GetListAsync(bool includeDetails = false);

[Obsolete("Use FindAsync method.")]
TenantConfiguration? Find(string normalizedName);

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.Extensions.Options;
Expand Down Expand Up @@ -26,6 +27,11 @@
return Task.FromResult(Find(id));
}

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

Check warning on line 33 in framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ConfigurationStore/DefaultTenantStore.cs

View check run for this annotation

Codecov / codecov/patch

framework/src/Volo.Abp.MultiTenancy/Volo/Abp/MultiTenancy/ConfigurationStore/DefaultTenantStore.cs#L31-L33

Added lines #L31 - L33 were not covered by tests

public TenantConfiguration? Find(string normalizedName)
{
return _options.Tenants?.FirstOrDefault(t => t.NormalizedName == normalizedName);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System;
using System.Collections.Generic;
using System.Threading.Tasks;
using JetBrains.Annotations;
using Volo.Abp.Caching;
Expand Down Expand Up @@ -37,6 +38,12 @@
return (await GetCacheItemAsync(id, null)).Value;
}

public virtual async Task<IReadOnlyList<TenantConfiguration>> GetListAsync(bool includeDetails = false)
{
return ObjectMapper.Map<List<Tenant>, List<TenantConfiguration>>(
await TenantRepository.GetListAsync(includeDetails));
}

Check warning on line 45 in modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs

View check run for this annotation

Codecov / codecov/patch

modules/tenant-management/src/Volo.Abp.TenantManagement.Domain/Volo/Abp/TenantManagement/TenantStore.cs#L42-L45

Added lines #L42 - L45 were not covered by tests

[Obsolete("Use FindAsync method.")]
public virtual TenantConfiguration Find(string normalizedName)
{
Expand Down
Loading