using Elsa.Common.Multitenancy;
using Elsa.Extensions;
using Elsa.Features.Abstractions;
using Elsa.Features.Services;
using Microsoft.Extensions.DependencyInjection;
namespace Elsa.Tenants.Features;
///
/// Enables tenant management endpoints.
///
public class TenantManagementFeature(IModule serviceConfiguration) : FeatureBase(serviceConfiguration)
{
private Func _tenantStoreFactory = sp => sp.GetRequiredService();
public TenantManagementFeature WithTenantStore(Func factory)
{
_tenantStoreFactory = factory;
return this;
}
///
public override void Apply()
{
Services
.AddMemoryStore()
.AddScoped(_tenantStoreFactory);
}
}