public async Task <ApiResponse <PagedResult <ImportsListItem> > > GetImports(ImportsGetListRequest request) { using (var scope = GlobalServices.Container.BeginLifetimeScope()) { var repository = scope.Resolve <ICloudSpeedRepository>(); var total = await repository.CountFileImports(); var entities = await repository.GetFileImports(request.Skip, request.Limit); var result = entities.Select(entity => new ImportsListItem { Id = entity.Id, Path = entity.Path, Status = entity.Status, Total = entity.Total, Success = entity.Success, Failed = entity.Failed, Error = entity.Error, Created = entity.Created, Updated = entity.Updated, }).ToList().AsEnumerable(); return(ApiResponse.Ok(request.ToPagedResult(result, total))); } }