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 1.6KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  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, TId>
  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<TId>> AddId(IEnumerable<TDboCreate> objs);
  18. LuResult<TId> AddId(TDboCreate obj);
  19. LuResult<IEnumerable<TDboRead>> AddDbo(IEnumerable<TDboCreate> obj);
  20. LuResult<TDboRead> AddDbo(TDboCreate obj);
  21. LuResult<TDboRead> GetSingleById(TId id);
  22. LuResult<LuPaginatedDbo<TDboRead>> GetMultiple(LuOrderByDbo orderBy, LuFilterDbo filter,
  23. int page = 0, int perPage = int.MaxValue);
  24. LuResult<LuPaginatedDbo<TDboRead>> GetMultiple(LuOrderByDbo orderBy, int page = 0, int perPage = int.MaxValue);
  25. LuResult<T> EditSingleById<T>(TId id, TDboUpdate update, Func<TDboRead, T> returnFunc);
  26. LuResult<TId> EditSingleByIdId(TId id, TDboUpdate update);
  27. LuResult<TDboRead> EditSingleByIdDbo(TId id, TDboUpdate update);
  28. LuResult<T> DeleteSingleById<T>(TId id, Func<TDboRead, T> returnFunc);
  29. LuResult<TId> DeleteSingleByIdId(TId id);
  30. LuResult<TDboRead> DeleteSingleByIdDbo(TId id);
  31. }
  32. }