1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
-
- using System.Collections.Generic;
- namespace EMIS.Entities.Log
- {
- public class TableKeyDictionary
- {
- private static Dictionary<string, string> items;
- public static Dictionary<string, string> Items
- {
- get { return items; }
- }
- static TableKeyDictionary()
- {
- items = new Dictionary<string, string>();
- items.Add("Log_Operate", "OperateID");
- items.Add("VW_Sys_User", "UserID");
- }
- public static string GetKeyName<TEntity>(TEntity entity)
- {
- string tableName = typeof(TEntity).Name;
- return items[tableName];
- }
- public static string GetKeyName<TEntity>()
- {
- string tableName = typeof(TEntity).Name;
- return items[tableName];
- }
- }
- }
|