Restore IActivityFactory and its implementation for backwards compatibility with 3.5.x, and register it in the DI container
This commit is contained in:
parent
471ae03266
commit
099a3204fd
|
|
@ -0,0 +1,9 @@
|
|||
using Elsa.Workflows.Models;
|
||||
|
||||
namespace Elsa.Workflows;
|
||||
|
||||
[Obsolete("Use the CreateActivity method on the ActivityConstructorContext context itself")]
|
||||
public interface IActivityFactory
|
||||
{
|
||||
IActivity Create(Type type, ActivityConstructorContext context);
|
||||
}
|
||||
|
|
@ -182,6 +182,7 @@ public class WorkflowsFeature : FeatureBase
|
|||
.AddScoped<IActivityRegistryLookupService, ActivityRegistryLookupService>()
|
||||
.AddSingleton<IPropertyDefaultValueResolver, PropertyDefaultValueResolver>()
|
||||
.AddSingleton<IPropertyUIHandlerResolver, PropertyUIHandlerResolver>()
|
||||
.AddSingleton<IActivityFactory, ActivityFactory>()
|
||||
.AddTransient<WorkflowBuilder>()
|
||||
.AddScoped(typeof(Func<IWorkflowBuilder>), sp => () => sp.GetRequiredService<WorkflowBuilder>())
|
||||
.AddScoped<IWorkflowBuilderFactory, WorkflowBuilderFactory>()
|
||||
|
|
|
|||
13
src/modules/Elsa.Workflows.Core/Services/ActivityFactory.cs
Normal file
13
src/modules/Elsa.Workflows.Core/Services/ActivityFactory.cs
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
using Elsa.Workflows.Models;
|
||||
|
||||
namespace Elsa.Workflows;
|
||||
|
||||
/// <inheritdoc />
|
||||
public class ActivityFactory : IActivityFactory
|
||||
{
|
||||
/// <inheritdoc />
|
||||
public IActivity Create(Type type, ActivityConstructorContext context)
|
||||
{
|
||||
return context.CreateActivity(type);
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue