Fix nullable warnings
This commit is contained in:
parent
660adacf61
commit
eba08c09de
|
|
@ -41,7 +41,7 @@ namespace Elsa.Services.Models
|
|||
public object? GetVariable(string name) => WorkflowExecutionContext.GetVariable(name);
|
||||
public T GetVariable<T>(string name) => WorkflowExecutionContext.GetVariable<T>(name);
|
||||
public T GetVariable<T>() => GetVariable<T>(typeof(T).Name);
|
||||
public T GetService<T>() => WorkflowExecutionContext.ServiceProvider.GetService<T>();
|
||||
public T GetService<T>() where T : notnull => WorkflowExecutionContext.ServiceProvider.GetRequiredService<T>();
|
||||
|
||||
public async ValueTask<IActivity> ActivateActivityAsync(CancellationToken cancellationToken = default)
|
||||
{
|
||||
|
|
@ -66,9 +66,9 @@ namespace Elsa.Services.Models
|
|||
return activity;
|
||||
}
|
||||
|
||||
public T GetInput<T>() => (T)Input!;
|
||||
public T GetInput<T>() => (T) Input!;
|
||||
public object? GetOutputFrom(string activityName) => WorkflowExecutionContext.GetOutputFrom(activityName);
|
||||
public T GetOutputFrom<T>(string activityName) => (T)GetOutputFrom(activityName)!;
|
||||
public T GetOutputFrom<T>(string activityName) => (T) GetOutputFrom(activityName)!;
|
||||
public void SetWorkflowContext(object? value) => WorkflowExecutionContext.SetWorkflowContext(value);
|
||||
public T GetWorkflowContext<T>() => WorkflowExecutionContext.GetWorkflowContext<T>();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ namespace Elsa.Triggers
|
|||
return await workflowBlueprint.GetActivityPropertyValue(activityId, propertyExpression, _activityExecutionContext, cancellationToken);
|
||||
}
|
||||
|
||||
public T GetState<T>(Expression<Func<TActivity, T>> propertyExpression)
|
||||
public T? GetState<T>(Expression<Func<TActivity, T>> propertyExpression)
|
||||
{
|
||||
var workflowBlueprint = _activityExecutionContext.WorkflowExecutionContext.WorkflowBlueprint;
|
||||
return workflowBlueprint.GetActivityState(propertyExpression, _activityExecutionContext);
|
||||
|
|
|
|||
Loading…
Reference in a new issue