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.

50 lines
1.8 KiB

2 years ago
  1. using System;
  2. using System.Collections.Generic;
  3. namespace SqlSugar
  4. {
  5. public class MappingTableList : List<MappingTable>
  6. {
  7. public void Add(string entityName, string dbTableName)
  8. {
  9. this.RemoveAll(it => it.EntityName.Equals(entityName, StringComparison.CurrentCultureIgnoreCase));
  10. this.Add(new MappingTable { EntityName = entityName, DbTableName = dbTableName });
  11. }
  12. public void Add(string entityName, string dbTableName, string dbTableShortName)
  13. {
  14. this.RemoveAll(it => it.EntityName.Equals(entityName, StringComparison.CurrentCultureIgnoreCase));
  15. this.Add(new MappingTable { EntityName = entityName, DbTableName = dbTableName, DbShortTaleName = dbTableShortName });
  16. }
  17. public new void Clear()
  18. {
  19. this.RemoveAll(it=>true);
  20. }
  21. }
  22. public class IgnoreColumnList : List<IgnoreColumn>
  23. {
  24. public void Add(string propertyName, string EntityName)
  25. {
  26. this.RemoveAll(it =>it.EntityName==EntityName&&it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase));
  27. this.Add(new IgnoreColumn { PropertyName = propertyName, EntityName = EntityName });
  28. }
  29. public new void Clear()
  30. {
  31. this.RemoveAll(it => true);
  32. }
  33. }
  34. public class MappingColumnList : List<MappingColumn>
  35. {
  36. public void Add(string propertyName, string dbColumnName, string entityName)
  37. {
  38. this.RemoveAll(it =>it.EntityName==entityName &&it.PropertyName.Equals(propertyName, StringComparison.CurrentCultureIgnoreCase));
  39. this.Add(new MappingColumn { PropertyName = propertyName, DbColumnName = dbColumnName, EntityName = entityName });
  40. }
  41. public new void Clear()
  42. {
  43. this.RemoveAll(it => true);
  44. }
  45. }
  46. }