From 8fd38a9949341bdc36d27eabf21b553a829f8bf9 Mon Sep 17 00:00:00 2001 From: Sipke Schoorstra Date: Sun, 14 Dec 2025 19:42:55 +0100 Subject: [PATCH] Mark `IActivityFactory` and related methods as obsolete; add `ActivityFactoryExtensions` for backward compatibility --- .../Elsa.Workflows.Core/Contracts/IActivityFactory.cs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/modules/Elsa.Workflows.Core/Contracts/IActivityFactory.cs b/src/modules/Elsa.Workflows.Core/Contracts/IActivityFactory.cs index deadc5337..cb41ef2de 100644 --- a/src/modules/Elsa.Workflows.Core/Contracts/IActivityFactory.cs +++ b/src/modules/Elsa.Workflows.Core/Contracts/IActivityFactory.cs @@ -5,5 +5,16 @@ namespace Elsa.Workflows; [Obsolete("Use the CreateActivity method on the ActivityConstructorContext context itself")] public interface IActivityFactory { + [Obsolete("Use the CreateActivity method on the ActivityConstructorContext context itself")] IActivity Create(Type type, ActivityConstructorContext context); +} + +[Obsolete("Use the CreateActivity method on the ActivityConstructorContext context itself")] +public static class ActivityFactoryExtensions +{ + [Obsolete("Use the CreateActivity method on the ActivityConstructorContext context itself")] + public static IActivity CreateActivity(this IActivityFactory factory, ActivityConstructorContext context) + { + return factory.Create(typeof(T), context); + } } \ No newline at end of file