public ProjectUpdateBatch GetLatestApprovedUpdateBatch() { var projectUpdateBatches = ProjectUpdateBatches .Where(x => x.ProjectUpdateState == ProjectUpdateState.Approved).ToList(); return(projectUpdateBatches.Any() ? projectUpdateBatches.MaxBy(x => x.LastUpdateDate) : null); }
public bool HasSubmittedOrApprovedUpdateBatchChangingProjectToCompleted() { return(ProjectUpdateBatches .Where(x => x.ProjectUpdateState == ProjectUpdateState.Approved || x.ProjectUpdateState == ProjectUpdateState.Submitted) .Any(x => x.ProjectUpdate?.ProjectStage == ProjectStage.Completed)); }