* Implement Alteration types and engine * Implement Alteration APIs * Refactor activity work item with support for activity input * Serialize scheduled activities as part of workflow state * Add signal to schedule child activity * Implement stores for plans and jobs * Add EF Core provider * Add Retry endpoint * Keep root context as always active. The root context is the workflow execution context and contains persistent variable state * Regenerate EF Core migrations * Handle orphaned activity execution contexts * Refactor workflow execution factory * Enable configuring Jint from Program * Update ModifyVariable alteration with support for type deserialization * Use ShortGuid for identity * Cleanup WorkflowServer host
28 lines
1.1 KiB
C#
28 lines
1.1 KiB
C#
using System.Reflection;
|
|
using Elsa.EntityFrameworkCore.Common;
|
|
using Microsoft.EntityFrameworkCore;
|
|
using Npgsql.EntityFrameworkCore.PostgreSQL.Infrastructure;
|
|
|
|
// ReSharper disable once CheckNamespace
|
|
namespace Elsa.EntityFrameworkCore.Extensions;
|
|
|
|
/// <summary>
|
|
/// Contains extension methods for <see cref="DbContextOptionsBuilder"/>.
|
|
/// </summary>
|
|
public static class DbContextOptionsBuilderExtensions
|
|
{
|
|
/// <summary>
|
|
/// Configures Entity Framework Core with PostgreSQL.
|
|
/// </summary>
|
|
public static DbContextOptionsBuilder UseElsaPostgreSql(this DbContextOptionsBuilder builder, Assembly migrationsAssembly, string connectionString,ElsaDbContextOptions? options = default, Action<NpgsqlDbContextOptionsBuilder>? configure = default) =>
|
|
builder
|
|
.UseElsaDbContextOptions(options)
|
|
.UseNpgsql(connectionString, db =>
|
|
{
|
|
db
|
|
.MigrationsAssembly(options.GetMigrationsAssemblyName(migrationsAssembly))
|
|
.MigrationsHistoryTable(options.GetMigrationsHistoryTableName(), options.GetSchemaName());
|
|
|
|
configure?.Invoke(db);
|
|
});
|
|
} |