示例#1
0
        public async Task <IEnumerable <DatasetToReadDTO> > ListDatasets(int limit, int offset)
        {
            var datasets = await _repository.FetchDatasetsAsync(limit, offset);

            return(datasets.Select(dataset => new DatasetToReadDTO
            {
                Id = dataset.Id,
                Name = dataset.Name,
                Records = dataset.Records.Select(record => new RecordDTO
                {
                    Inputs = record.Inputs,
                    Output = record.Output
                }).ToArray()
            }));
        }