private Task ApplyUpdateRequest(Department d, UpdateDepartment update) { d.Name = update.Name; d.Budget = update.Budget; d.AdministratorId = update.AdministratorId; d.StartDate = update.StartDate; return(_departmentRepository.Update(d)); }
private async Task <Validation <Error, Department> > Validate(UpdateDepartment update) => (ValidateDepartmentName(update), ValidateBudget(update), MustStartInFuture(update),
public Task <Either <Error, Task> > Handle(UpdateDepartment request, CancellationToken cancellationToken) => Validate(request) .MapT(d => ApplyUpdateRequest(d, request)) .Map(v => v.ToEither <Task>());