ExpressionParameter.cs 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Linq.Expressions;
  5. using System.Text;
  6. using System.Threading.Tasks;
  7. namespace SqlSugar
  8. {
  9. public class ExpressionParameter
  10. {
  11. public ExpressionContext Context { get; set; }
  12. public ExpressionParameter BaseParameter { get; set; }
  13. public Expression BaseExpression { get; set; }
  14. public Expression ChildExpression { get; set; }
  15. public Expression LeftExpression { get; set; }
  16. public Expression RightExpression { get; set; }
  17. public Expression CurrentExpression { get; set; }
  18. public string OperatorValue { get; set; }
  19. public bool? IsLeft { get; set; }
  20. public int Index { get; set; }
  21. public bool ValueIsNull { get; set; }
  22. public object CommonTempData { get; set; }
  23. public ExpressionResultAppendType AppendType { get; set; }
  24. public void IsAppendResult()
  25. {
  26. this.AppendType = ExpressionResultAppendType.AppendResult;
  27. }
  28. public void IsAppendTempDate()
  29. {
  30. this.AppendType = ExpressionResultAppendType.AppendTempDate;
  31. }
  32. public Expression OppsiteExpression
  33. {
  34. get
  35. {
  36. return this.IsLeft == true ? this.BaseParameter.RightExpression : this.BaseParameter.LeftExpression;
  37. }
  38. }
  39. public bool IsSetTempData
  40. {
  41. get
  42. {
  43. return BaseParameter.CommonTempData.HasValue() && BaseParameter.CommonTempData.Equals(CommonTempDataType.Result);
  44. }
  45. }
  46. }
  47. }