You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LuPaginatedDbo.cs 720B

12345678910111213141516171819202122232425262728293031
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. namespace Luticate2.Utils.Dbo.Basic
  5. {
  6. public class LuPaginatedDbo<TDbo>
  7. {
  8. public long Count { get; set; }
  9. public List<TDbo> Data { get; set; }
  10. public LuPaginatedDbo<T> To<T>(Func<List<TDbo>, List<T>> convert)
  11. {
  12. return new LuPaginatedDbo<T>
  13. {
  14. Count = Count,
  15. Data = convert(Data)
  16. };
  17. }
  18. public LuPaginatedDbo<T> Select<T>(Func<TDbo, T> convert)
  19. {
  20. return new LuPaginatedDbo<T>
  21. {
  22. Count = Count,
  23. Data = Data.Select(convert).ToList()
  24. };
  25. }
  26. }
  27. }