diff --git a/src/modules/Elsa.Expressions/Services/WellKnownTypeRegistry.cs b/src/modules/Elsa.Expressions/Services/WellKnownTypeRegistry.cs index 68198b045..67d36f75b 100644 --- a/src/modules/Elsa.Expressions/Services/WellKnownTypeRegistry.cs +++ b/src/modules/Elsa.Expressions/Services/WellKnownTypeRegistry.cs @@ -32,6 +32,7 @@ public class WellKnownTypeRegistry : IWellKnownTypeRegistry this.RegisterType("TimeOnly"); this.RegisterType("ExpandoObject"); this.RegisterType>("StringDictionary"); + this.RegisterType>("ObjectDictionary"); } /// diff --git a/src/modules/Elsa.Http/Activities/HttpEndpoint.cs b/src/modules/Elsa.Http/Activities/HttpEndpoint.cs index 23579f891..6c4ef3812 100644 --- a/src/modules/Elsa.Http/Activities/HttpEndpoint.cs +++ b/src/modules/Elsa.Http/Activities/HttpEndpoint.cs @@ -9,6 +9,7 @@ using Elsa.Workflows.Core.Models; using Microsoft.AspNetCore.Http; using Microsoft.AspNetCore.Routing; using Microsoft.Extensions.DependencyInjection; +using Microsoft.Extensions.Primitives; namespace Elsa.Http; @@ -64,19 +65,19 @@ public class HttpEndpoint : Trigger /// The parsed route data, if any. /// [Output(Description = "The parsed route data, if any.")] - public Output> RouteData { get; set; } = default!; + public Output> RouteData { get; set; } = default!; /// /// The querystring data, if any. /// [Output(Description = "The querystring data, if any.")] - public Output> QueryStringData { get; set; } = default!; + public Output> QueryStringData { get; set; } = default!; /// /// The headers, if any. /// [Output(Description = "The headers, if any.")] - public Output> Headers { get; set; } = default!; + public Output> Headers { get; set; } = default!; /// protected override IEnumerable GetTriggerPayloads(TriggerIndexingContext context) => GetBookmarkPayloads(context.ExpressionExecutionContext); @@ -157,22 +158,9 @@ public class HttpEndpoint : Trigger var path = context.GetInput(RequestPathInputKey); var routeData = GetRouteData(httpContext, path); - var routeDictionary = new Dictionary(); - foreach (var route in routeData.Values) { - routeDictionary.Add(route.Key, route.Value); - } - - var queryStringDictionary = new Dictionary(); - foreach (var queryString in httpContext.Request.Query) - { - queryStringDictionary.Add(queryString.Key, queryString.Value[0]); - } - - var headersDictionary = new Dictionary(); - foreach (var header in httpContext.Request.Headers) - { - headersDictionary.Add(header.Key, header.Value[0]); - } + var routeDictionary = routeData.Values.ToDictionary(route => route.Key, route => route.Value); + var queryStringDictionary = httpContext.Request.Query.ToDictionary, string, object>(queryString => queryString.Key, queryString => queryString.Value[0]!); + var headersDictionary = httpContext.Request.Headers.ToDictionary, string, object>(header => header.Key, header => header.Value[0]!); context.Set(RouteData, routeDictionary); context.Set(QueryStringData, queryStringDictionary); diff --git a/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs b/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs index c1c58a378..bf6906a59 100644 --- a/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs +++ b/src/modules/Elsa.Workflows.Management/Features/WorkflowManagementFeature.cs @@ -71,6 +71,7 @@ public class WorkflowManagementFeature : FeatureBase new(typeof(DateOnly), PrimitivesCategory, "Represents dates with values ranging from January 1, 0001 Anno Domini (Common Era) through December 31, 9999 A.D. (C.E.) in the Gregorian calendar."), new(typeof(TimeOnly), PrimitivesCategory, "Represents a time of day, as would be read from a clock, within the range 00:00:00 to 23:59:59.9999999."), new(typeof(IDictionary), LookupsCategory, "A dictionary with string key and values."), + new(typeof(IDictionary), LookupsCategory, "A dictionary with string key and object values."), new (typeof(ExpandoObject), DynamicCategory, "A dictionary that can be typed as dynamic to access members using dot notation."), new (typeof(JsonObject), DynamicCategory, "A type from System.Text.Json that provides dynamic access to the object.") }; diff --git a/src/modules/Elsa.Workflows.Management/Options/ManagementOptions.cs b/src/modules/Elsa.Workflows.Management/Options/ManagementOptions.cs index a743cbe6b..0a65f8498 100644 --- a/src/modules/Elsa.Workflows.Management/Options/ManagementOptions.cs +++ b/src/modules/Elsa.Workflows.Management/Options/ManagementOptions.cs @@ -2,6 +2,9 @@ using Elsa.Workflows.Management.Models; namespace Elsa.Workflows.Management.Options; +/// +/// Options for the management module. +/// public class ManagementOptions { ///