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.

38 lines
1.0 KiB

4 years ago
4 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace Apewer.Source
  5. {
  6. /// <summary>用于执行 SQL 语句的参数。</summary>
  7. [Serializable]
  8. public class Parameter
  9. {
  10. /// <summary>名称,不可设置位为空。</summary>
  11. public string Name { get; set; }
  12. /// <summary>值。</summary>
  13. public object Value { get; set; }
  14. /// <summary>类型。</summary>
  15. public ColumnType Type { get; set; }
  16. /// <summary>类型为 VarChar 时,指定长度。</summary>
  17. public int Size { get; set; }
  18. /// <summary>创建用于执行 SQL 语句的参数,名称不可设置位为空。</summary>
  19. /// <exception cref="ArgumentException"></exception>
  20. /// <exception cref="ArgumentNullException"></exception>
  21. public Parameter(string name, object value, ColumnType type, int size = 0)
  22. {
  23. Name = name;
  24. Value = value;
  25. Type = type;
  26. Size = size;
  27. }
  28. }
  29. }