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.9KB

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