* Refactor: Update namespaces and add TenantExtensions Updated namespaces throughout the project to improve clarity and consistency by moving from 'Common' to appropriate modules. Added TenantExtensions class to simplify fetching connection strings for tenants. * Implement multitenant DB connection strings Redesign tenant-specific classes to support multitenancy more effectively. Introduce `MultitenantBackgroundService` and `MultitenantHostedService` for handling tasks per tenant. * Refactor constructors and remove redundant code Simplified the constructor parameters for `MultitenantBackgroundService` and `List` class. Removed the unused parameter in `MultitenantBackgroundService` and redundant folder inclusion in the project file. Updated the method calls to use direct parameters in `List` class. * Remove unused import in ActivityDescriptors Endpoint The Elsa.Common.Multitenancy import was removed as it is unused in the List/Endpoint.cs file. Removing unused imports helps to improve code readability and maintainability. This change does not affect functionality.
22 lines
779 B
C#
22 lines
779 B
C#
using System.Reflection;
|
|
using Elsa.Secrets.Persistence.EntityFrameworkCore;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace Elsa.EntityFrameworkCore.Extensions;
|
|
|
|
/// <summary>
|
|
/// Provides extensions to configure EF Core to use SqlServer.
|
|
/// </summary>
|
|
public static class SecretsSqlServerProvidersExtensions
|
|
{
|
|
private static Assembly Assembly => typeof(SecretsSqlServerProvidersExtensions).Assembly;
|
|
|
|
/// <summary>
|
|
/// Configures the feature to use SqlServer.
|
|
/// </summary>
|
|
public static EFCoreSecretPersistenceFeature UseSqlServer(this EFCoreSecretPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = null)
|
|
{
|
|
feature.UseSqlServer(Assembly, connectionString, options);
|
|
return feature;
|
|
}
|
|
} |