Fix warnings

This commit is contained in:
Sipke Schoorstra 2020-11-18 20:35:03 +01:00
parent 956f8ed1fa
commit 660adacf61

View file

@ -12,7 +12,7 @@ namespace Elsa.Builders
public interface ISetupActivity<T> : ISetupActivity where T : IActivity
{
ISetupActivity<T> Set<TProperty>(Expression<Func<T, TProperty>> propertyAccessor,
ISetupActivity<T> Set<TProperty>(Expression<Func<T, TProperty?>> propertyAccessor,
Func<ActivityExecutionContext, ValueTask<TProperty?>> valueFactory);
}
@ -20,8 +20,8 @@ namespace Elsa.Builders
{
public static ISetupActivity<T> Set<T, TProperty>(
this ISetupActivity<T> builder,
Expression<Func<T, TProperty>> propertyAccessor,
Func<ActivityExecutionContext, ValueTask<TProperty>> valueFactory) where T : IActivity =>
Expression<Func<T, TProperty?>> propertyAccessor,
Func<ActivityExecutionContext, ValueTask<TProperty?>> valueFactory) where T : IActivity =>
builder.Set(propertyAccessor, async context => await valueFactory(context));
public static ISetupActivity<T> Set<T, TProperty>(
@ -38,14 +38,14 @@ namespace Elsa.Builders
public static ISetupActivity<T> Set<T, TProperty>(
this ISetupActivity<T> builder,
Expression<Func<T, TProperty>> propertyAccessor,
Func<ValueTask<TProperty>> valueFactory) where T : IActivity =>
Expression<Func<T, TProperty?>> propertyAccessor,
Func<ValueTask<TProperty?>> valueFactory) where T : IActivity =>
builder.Set(propertyAccessor, async _ => await valueFactory());
public static ISetupActivity<T> Set<T, TProperty>(
this ISetupActivity<T> builder,
Expression<Func<T, TProperty?>> propertyAccessor,
TProperty? value) where T : IActivity =>
builder.Set(propertyAccessor, context => new ValueTask<TProperty?>(value));
builder.Set(propertyAccessor, _ => new ValueTask<TProperty?>(value));
}
}