コード例 #1
0
 private async Task <Validation <Error, Enrollment> > Validate(CreateEnrollment create) =>
 (await CourseMustExist(create), await StudentMustExist(create))
コード例 #2
0
 public Task <Validation <Error, int> > Handle(CreateEnrollment request, CancellationToken cancellationToken) =>
 from validation in
 from v in Validate(request)
 select Persist(v)
 from result in validation.Traverse(i => i)     // Await the inner task
 select result;