public Sprint ToSprint(SprintDto sprintD) { Sprint sprint = new Sprint() { Name = sprintD.Name, Description = sprintD.Description, StartDate = sprintD.StartDate, EndDate = sprintD.EndDate, Priority = sprintD.Priority, isDone = sprintD.isDone }; return sprint; }
public SprintDto ToSprintDto(Sprint sprint, List<Project> projects = null) { SprintDto sprintDto = new SprintDto() { Id = sprint.Id, Name = sprint.Name, Description = sprint.Description, StartDate = sprint.StartDate, EndDate = sprint.EndDate, Priority = sprint.Priority, isDone = sprint.isDone, Percent = GetPercents(sprint.StartDate, sprint.EndDate), Projects = projects == null ? new List<ProjectDto>() : projects.Select(x => ToProjectDto(x)).ToList() }; return sprintDto; }