ConditionalModel.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace SqlSugar
  6. {
  7. public interface IConditionalModel {
  8. }
  9. public class ConditionalCollections : IConditionalModel
  10. {
  11. public List<KeyValuePair<WhereType, ConditionalModel>> ConditionalList { get; set; }
  12. }
  13. public class ConditionalTree : IConditionalModel
  14. {
  15. public List<KeyValuePair<WhereType, IConditionalModel>> ConditionalList { get; set; }
  16. }
  17. public class ConditionalModel: IConditionalModel
  18. {
  19. public ConditionalModel()
  20. {
  21. this.ConditionalType = ConditionalType.Equal;
  22. }
  23. public string FieldName { get; set; }
  24. public string FieldValue { get; set; }
  25. public string CSharpTypeName { get; set; }
  26. public ICustomConditionalFunc CustomConditionalFunc { get; set; }
  27. public object CustomParameterValue { get; set; }
  28. public ConditionalType ConditionalType { get; set; }
  29. [Newtonsoft.Json.JsonIgnoreAttribute]
  30. public Func<string,object> FieldValueConvertFunc { get; set; }
  31. public static List<IConditionalModel> Create(params IConditionalModel[] conditionalModel)
  32. {
  33. return conditionalModel.ToList();
  34. }
  35. }
  36. }