Actually, I should not have handled obsolete classes/interfaces.

Handling that as it should without changing the contract
This commit is contained in:
j03y-nxxbz 2026-01-20 13:33:47 +01:00
parent 4cd2c4cda6
commit b3d155de63
2 changed files with 4 additions and 4 deletions

View file

@ -6,14 +6,14 @@ namespace Elsa.Workflows;
public interface IActivityFactory
{
[Obsolete("Use the CreateActivity method on the ActivityConstructorContext context itself")]
ActivityConstructionResult Create(Type type, ActivityConstructorContext context);
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 ActivityConstructionResult CreateActivity<T>(this IActivityFactory factory, ActivityConstructorContext context)
public static IActivity CreateActivity<T>(this IActivityFactory factory, ActivityConstructorContext context)
{
return factory.Create(typeof(T), context);
}

View file

@ -6,8 +6,8 @@ namespace Elsa.Workflows;
public class ActivityFactory : IActivityFactory
{
/// <inheritdoc />
public ActivityConstructionResult Create(Type type, ActivityConstructorContext context)
public IActivity Create(Type type, ActivityConstructorContext context)
{
return context.CreateActivity(type);
return context.CreateActivity(type).Activity;
}
}