Skip to content

Commit 9dc2c3c

Browse files
committed
Add ignored file
1 parent d992958 commit 9dc2c3c

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
using FluentValidation;
2+
using ServerlessWorkflow.Sdk.Models;
3+
4+
namespace ServerlessWorkflow.Sdk.Services.Validation
5+
{
6+
/// <summary>
7+
/// Represents the service used to validate <see cref="SubflowReference"/>s
8+
/// </summary>
9+
public class SubflowReferenceValidator
10+
: AbstractValidator<SubflowReference>
11+
{
12+
13+
/// <summary>
14+
/// Initializes a new <see cref="SubflowReferenceValidator"/>
15+
/// </summary>
16+
/// <param name="workflow">The <see cref="WorkflowDefinition"/> the <see cref="SubflowReference"/>s to validate belong to</param>
17+
public SubflowReferenceValidator(WorkflowDefinition workflow)
18+
{
19+
this.Workflow = workflow;
20+
this.RuleFor(w => w.WorkflowId)
21+
.NotEmpty()
22+
.WithErrorCode($"{nameof(SubflowReference)}.{nameof(SubflowReference.WorkflowId)}");
23+
}
24+
25+
/// <summary>
26+
/// Gets the <see cref="WorkflowDefinition"/> the <see cref="FunctionReference"/>s to validate belong to
27+
/// </summary>
28+
protected WorkflowDefinition Workflow { get; }
29+
30+
}
31+
32+
}

0 commit comments

Comments
 (0)