Json2SqlConfig.cs 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace SqlSugar
  5. {
  6. public static class JsonProviderConfig
  7. {
  8. public const string KeyInsertable = "Insertable";
  9. public const string KeyUpdateable = "Updateable";
  10. public const string KeyQueryable = "Queryable";
  11. public const string KeyDeleteable = "Deleteable";
  12. private static Dictionary<string, string> words = new Dictionary<string, string>()
  13. {
  14. { KeyInsertable,"Table"},
  15. { KeyUpdateable,"Table"},
  16. { KeyQueryable,"Table"},
  17. { KeyDeleteable,"Table"}
  18. };
  19. public static string Rename(string key,string name)
  20. {
  21. return words[key]=name;
  22. }
  23. internal static string Get(this string value)
  24. {
  25. return words[value];
  26. }
  27. internal static string GetWord(string key)
  28. {
  29. Check.ExceptionEasy(words.ContainsKey(key) == false, $"{key} is error", $"{key} 不存在 ");
  30. return words[key];
  31. }
  32. }
  33. }