* Restructuring (WIP) * Fix warnings * Move DSL to modules * Update namespaces * Make design factory base reusable * Update service registrations * Remove unused namespaces and rename ElsaDbContext * Incremental work on migrations * Generate WorkflowsDbContext SQLite migrations * Rename ServiceCollectionExtensions * Update DbContextOptionsBuilderExtensions.cs * Restructure * Configuration refactorings (WIP) * Incremental work on configurator API * Incremental work on configuration API * Incremental work on configuration API * Fix workflow runtime options * Move standard stream providers * Implement configurator dependencies * Cleanup configurator API * Update configurator dependencies * Cleanup * Update Label API endpoints * Fix eager configuration issue
27 lines
719 B
C#
27 lines
719 B
C#
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text.Json;
|
|
using Elsa.Runtime.Protos;
|
|
|
|
namespace Elsa.ProtoActor.Extensions;
|
|
|
|
public static class ProtoInputExtensions
|
|
{
|
|
public static IDictionary<string, object> Deserialize(this Input input) => input.Data.ToDictionary(x => x.Key, x => JsonSerializer.Deserialize<object>(x.Value.Text)!);
|
|
|
|
public static Input Serialize(this IDictionary<string, object> input)
|
|
{
|
|
var result = new Input();
|
|
var data = result.Data;
|
|
|
|
foreach (var (key, value) in input)
|
|
{
|
|
data[key] = new Json
|
|
{
|
|
Text = JsonSerializer.Serialize(value)
|
|
};
|
|
}
|
|
|
|
return result;
|
|
}
|
|
} |