SubWithNoLock.cs 951 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6. namespace SqlSugar
  7. {
  8. public class SubWithNolock : ISubOperation
  9. {
  10. public ExpressionContext Context
  11. {
  12. get;set;
  13. }
  14. public Expression Expression
  15. {
  16. get;set;
  17. }
  18. public bool HasWhere
  19. {
  20. get;set;
  21. }
  22. public string Name
  23. {
  24. get
  25. {
  26. return "WithNoLock";
  27. }
  28. }
  29. public int Sort
  30. {
  31. get
  32. {
  33. return 301;
  34. }
  35. }
  36. public string GetValue(Expression expression)
  37. {
  38. if (Context is SqlServerExpressionContext)
  39. {
  40. return SqlWith.NoLock;
  41. }
  42. else
  43. {
  44. return "";
  45. }
  46. }
  47. }
  48. }