Mark IActivityFactory and related methods as obsolete; add ActivityFactoryExtensions for backward compatibility

This commit is contained in:
Sipke Schoorstra 2025-12-14 19:42:55 +01:00
parent 33af795704
commit 8fd38a9949
No known key found for this signature in database
GPG key ID: 5C10502B28A4268F

View file

@ -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<T>(this IActivityFactory factory, ActivityConstructorContext context)
{
return factory.Create(typeof(T), context);
}
}