Nelze vybrat více než 25 témat Téma musí začínat písmenem nebo číslem, může obsahovat pomlčky („-“) a může být dlouhé až 35 znaků.

ILuCrudInterface.cs 2.2KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. using System;
  2. using System.Collections.Generic;
  3. using Luticate2.Utils.Dbo;
  4. using Luticate2.Utils.Dbo.Basic;
  5. using Luticate2.Utils.Dbo.Filter;
  6. using Luticate2.Utils.Dbo.OrderBy;
  7. using Luticate2.Utils.Dbo.Result;
  8. namespace Luticate2.Utils.Interfaces
  9. {
  10. public interface ILuCrudInterface<TDboCreate, TDboRead, TDboUpdate>
  11. where TDboCreate : class
  12. where TDboRead : class
  13. where TDboUpdate : class
  14. {
  15. LuResult<T> Add<T>(IEnumerable<TDboCreate> objs, Func<IEnumerable<TDboRead>, T> returnFunc);
  16. LuResult<T> Add<T>(TDboCreate obj, Func<TDboRead, T> returnFunc);
  17. LuResult<IEnumerable<string>> AddGuid(IEnumerable<TDboCreate> objs);
  18. LuResult<string> AddGuid(TDboCreate obj);
  19. LuResult<IEnumerable<long>> AddId(IEnumerable<TDboCreate> obj);
  20. LuResult<long> AddId(TDboCreate obj);
  21. LuResult<IEnumerable<TDboRead>> AddDbo(IEnumerable<TDboCreate> obj);
  22. LuResult<TDboRead> AddDbo(TDboCreate obj);
  23. LuResult<TDboRead> GetSingleById(string id);
  24. LuResult<TDboRead> GetSingleById(long id);
  25. LuResult<LuPaginatedDbo<TDboRead>> GetMultiple(LuOrderByDbo orderBy, LuFilterDbo filter,
  26. int page = 0, int perPage = int.MaxValue);
  27. LuResult<LuPaginatedDbo<TDboRead>> GetMultiple(LuOrderByDbo orderBy, int page = 0, int perPage = int.MaxValue);
  28. LuResult<T> EditSingleById<T>(long id, TDboUpdate update, Func<TDboRead, T> returnFunc);
  29. LuResult<long> EditSingleByIdId(long id, TDboUpdate update);
  30. LuResult<TDboRead> EditSingleByIdDbo(long id, TDboUpdate update);
  31. LuResult<T> EditSingleById<T>(string id, TDboUpdate update, Func<TDboRead, T> returnFunc);
  32. LuResult<string> EditSingleByIdGuid(string id, TDboUpdate update);
  33. LuResult<TDboRead> EditSingleByIdDbo(string id, TDboUpdate update);
  34. LuResult<T> DeleteSingleById<T>(string id, Func<TDboRead, T> returnFunc);
  35. LuResult<string> DeleteSingleByIdGuid(string id);
  36. LuResult<TDboRead> DeleteSingleByIdDbo(string id);
  37. LuResult<T> DeleteSingleById<T>(long id, Func<TDboRead, T> returnFunc);
  38. LuResult<long> DeleteSingleByIdId(long id);
  39. LuResult<TDboRead> DeleteSingleByIdDbo(long id);
  40. }
  41. }