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.

33 lines
954 B

2 years ago
  1. using EasyNet.DBUtility;
  2. using System.Collections.Generic;
  3. using System.Data;
  4. namespace EasyNet.Common
  5. {
  6. public class TableInfo
  7. {
  8. public string TableName { get; set; }
  9. public bool Strategy { get; set; } = false;
  10. public List<IdInfo> Ids { get; set; } = new List<IdInfo>();
  11. public IdInfo Id { get; set; } = new IdInfo();
  12. public ColumnInfo Columns { get; set; } = new ColumnInfo();
  13. public Map PropToColumn { get; set; } = new Map();
  14. public Map Keycolumns { get; set; } = new Map();
  15. public IDbDataParameter[] GetParameters()
  16. {
  17. IDbDataParameter[] parameters = null;
  18. if (this.Columns != null && this.Columns.Count > 0)
  19. {
  20. parameters = DbFactory.CreateDbParameters(this.Columns.Count);
  21. DbEntityUtils.SetParameters(this.Columns, parameters);
  22. }
  23. return parameters;
  24. }
  25. }
  26. }