elsa-core/src/modules/Elsa.Agents.Persistence.EntityFrameworkCore.PostgreSql/PostgreSqlProvidersExtensions.cs
Sipke Schoorstra 9f65310353 Add PostgreSQL support for database providers
Introduced PostgreSQL as a new database provider option in the application. Created an enumeration for SQL database providers and updated configurations and project references to support PostgreSQL. Adjusted logic to accommodate the new provider, ensuring integration across components.
2024-12-01 11:04:16 +01:00

22 lines
780 B
C#

using System.Reflection;
using Elsa.Agents.Persistence.EntityFrameworkCore;
// ReSharper disable once CheckNamespace
namespace Elsa.EntityFrameworkCore.Extensions;
/// <summary>
/// Provides extensions to configure EF Core to use SQL Server.
/// </summary>
public static class AgentsPostgreSqlProvidersExtensions
{
private static Assembly Assembly => typeof(AgentsPostgreSqlProvidersExtensions).Assembly;
/// <summary>
/// Configures the feature to use SQL Server.
/// </summary>
public static EFCoreAgentPersistenceFeature UsePostgreSql(this EFCoreAgentPersistenceFeature feature, string connectionString, ElsaDbContextOptions? options = null)
{
feature.UsePostgreSql(Assembly, connectionString, options);
return feature;
}
}