Esempio n. 1
0
 private Course ApplyUpdate(Course c, UpdateCourse request) =>
 new Course
 {
     CourseId     = c.CourseId,
     DepartmentId = request.DepartmentId,
     Credits      = request.Credits,
     Title        = request.Title
 };
Esempio n. 2
0
 private async Task <Validation <Error, Course> > Validate(UpdateCourse updateCourse) =>
 (ValidateTitle(updateCourse), await DepartmentMustExist(updateCourse),
Esempio n. 3
0
 public Task <Validation <Error, Task <Unit> > > Handle(UpdateCourse request, CancellationToken cancellationToken) =>
 Validate(request)
 .MapT(c => ApplyUpdate(c, request))
 .MapT(Persist);