TableKey.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. 
  2. //------------------------------------------------------------------------------
  3. // <auto-generated>
  4. // This code was generated from a template.
  5. //
  6. // Manual changes to this file may cause unexpected behavior in your application.
  7. // Manual changes to this file will be overwritten if the code is regenerated.
  8. // </auto-generated>
  9. //------------------------------------------------------------------------------
  10. using System.Collections.Generic;
  11. namespace EMIS.Entities.Log
  12. {
  13. public class TableKeyDictionary
  14. {
  15. private static Dictionary<string, string> items;
  16. public static Dictionary<string, string> Items
  17. {
  18. get { return items; }
  19. }
  20. static TableKeyDictionary()
  21. {
  22. items = new Dictionary<string, string>();
  23. items.Add("Log_Operate", "OperateID");
  24. items.Add("VW_Sys_User", "UserID");
  25. }
  26. public static string GetKeyName<TEntity>(TEntity entity)
  27. {
  28. string tableName = typeof(TEntity).Name;
  29. return items[tableName];
  30. }
  31. public static string GetKeyName<TEntity>()
  32. {
  33. string tableName = typeof(TEntity).Name;
  34. return items[tableName];
  35. }
  36. }
  37. }