Setting.cs 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace SqlSugar
  7. {
  8. public partial class FastestProvider<T> : IFastest<T> where T : class, new()
  9. {
  10. private string AsName { get; set; }
  11. private int Size { get; set; }
  12. private string CacheKey { get; set; }
  13. private string CacheKeyLike { get; set; }
  14. private string CharacterSet { get; set; }
  15. private bool IsDataAop { get; set; }
  16. private bool IsOffIdentity { get; set; }
  17. public IFastest<T> SetCharacterSet(string CharacterSet)
  18. {
  19. this.CharacterSet = CharacterSet;
  20. return this;
  21. }
  22. public IFastest<T> EnableDataAop()
  23. {
  24. this.IsDataAop = true;
  25. return this;
  26. }
  27. public IFastest<T> RemoveDataCache()
  28. {
  29. CacheKey = typeof(T).FullName;
  30. return this;
  31. }
  32. public IFastest<T> RemoveDataCache(string cacheKey)
  33. {
  34. CacheKeyLike = this.context.EntityMaintenance.GetTableName<T>();
  35. return this;
  36. }
  37. public IFastest<T> AS(string tableName)
  38. {
  39. this.AsName = tableName;
  40. return this;
  41. }
  42. public IFastest<T> PageSize(int size)
  43. {
  44. this.Size = size;
  45. return this;
  46. }
  47. public IFastest<T> OffIdentity()
  48. {
  49. this.IsOffIdentity = true;
  50. return this;
  51. }
  52. public SplitFastest<T> SplitTable()
  53. {
  54. SplitFastest<T> result = new SplitFastest<T>();
  55. result.FastestProvider = this;
  56. return result;
  57. }
  58. }
  59. }