李昊 il y a 4 ans
Parent
commit
348443e507

+ 5 - 1
gx_api/GxPress/Repository/GxPress.Repository.Implement/Media/MediaLibraryRepository.cs

@@ -49,7 +49,11 @@ namespace GxPress.Repository.Implement.Media
         /// <returns></returns>
         public async Task<List<MediaLibraryResult>> GetAllAsync(int mediaId)
         {
-            var result = await _repository.GetAllAsync(Q.Select(nameof(Entity.tede2.Media.MediaLibrary.Id), nameof(Entity.tede2.Media.MediaLibrary.Name), nameof(Entity.tede2.Media.MediaLibrary.MediaId)).Where(nameof(Entity.tede2.Media.MediaLibrary.MediaId), mediaId).Where(nameof(Entity.tede2.Media.MediaLibrary.TypeId), 0));
+            var selectColumn = new List<string>();
+            selectColumn.Add(nameof(Entity.tede2.Media.MediaLibrary.Id));
+            selectColumn.Add(nameof(Entity.tede2.Media.MediaLibrary.Name));
+            selectColumn.Add(nameof(Entity.tede2.Media.MediaLibrary.MediaId));
+            var result = await _repository.GetAllAsync<MediaLibraryResult>(Q.Select(selectColumn.ToArray()).Where(nameof(Entity.tede2.Media.MediaLibrary.MediaId), mediaId).Where(nameof(Entity.tede2.Media.MediaLibrary.TypeId), 0));
             return result.Select(n => _mapper.Map<MediaLibraryResult>(n)).ToList();
         }
     }