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.

ILuCrudInterface.cs 2.0KB

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