我不熟悉使用无状态并试图确保我理解保护条款的目的。我能够创建一个状态机,但我想基本上检查进入年龄 > 12 && 父权限存在的状态。我是否正确理解了 Guard 条款,如果是,我将如何实施这样的条款?
var stateMachine = new StateMachine<State, Trigger>(State.EnrollmentCompleted);
stateMachine.Configure(State.EnrollmentCompleted)
.Permit(Trigger.EnrollmentCompleted,ValidatingEnrollment, ***Guardclause to check if user age > 12 and Parentpermission=true***);
return stateMachine;