public async Task <int> AddWorkingDays(int sprintId, int memberId, int workingDays) { var sprint = await _manageSprintsService.GetSprintAsync(sprintId, false); if (TryValidateModel(MemberWorkingDays.Create(memberId, sprintId, sprint, workingDays))) { var result = await _manageMemberWorkingDaysService.AddMemberWorkingDaysAsync(MemberWorkingDays.Create(memberId, sprintId, null, workingDays)); if (result) { var memberWorkingDays = await _manageMemberWorkingDaysService.GetAllWorkingDaysForSprintAsync(sprintId); return(memberWorkingDays.FirstOrDefault(i => i.MemberId == memberId).Id); } else { return(-1); } } else { return(-1); } }
public async Task <int> AddWorkingDays(int sprintId, int memberId, int workingDays) { var result = await _manageMemberWorkingDaysService.AddMemberWorkingDaysAsync(new MemberWorkingDays { SprintId = sprintId, MemberId = memberId, WorkingDays = workingDays }); if (result) { var memberWorkingDays = await _manageMemberWorkingDaysService.GetAllWorkingDaysForSprintAsync(sprintId); return(memberWorkingDays.FirstOrDefault(i => i.MemberId == memberId).Id); } else { return(-1); } }