private AnalysisDatasetDTO WriteDTO(AnalysisDataset d) { List <ExportFile> files = new List <ExportFile>(); foreach (var fid in d.FileIds) { files.Add(_exportFileRepository.FindSingle(a => a.Id == Guid.Parse(fid))); } var dto = new AnalysisDatasetDTO() { Id = d.Id, Name = d.Name, Description = d.Description, OwnerId = d.OwnerId, ProjectId = d.ProjectId, Files = files.Select(f => new ExportFileDTO() { Id = f.Id.ToString(), FileStatus = f.FileStatus, ContentType = f.ContentType, Name = f.Name, SampleCount = f.SampleCount, SubjectCount = f.SubjectCount, QueryId = f.QueryId.ToString() }).ToList() }; return(dto); }
public AnalysisDatasetDTO SaveToDataset(AnalysisDatasetDTO datasetDTO, string userId) { AnalysisDataset analysisDataset = new AnalysisDataset() { Name = datasetDTO.Name, Description = datasetDTO.Description, Id = Guid.NewGuid(), ProjectId = datasetDTO.ProjectId, OwnerId = datasetDTO.OwnerId = userId, FileIds = datasetDTO.Files.Select(f => f.Id).ToList(), Tags = datasetDTO.Tags }; _analysisDatasetRepository.Insert(analysisDataset); return(null); }