/// <summary> /// Disconnects the current session and starts a new one. /// </summary> /// <param name="entityType"></param> public static void StartNewSession(Type entityType) { TableMapping mapping = DataMapper.GetTableMapping(entityType); // Make sure this type has been registered with a session key. if (mapping != null) { StartNewSession(mapping.Key); } }
/// <summary> /// Gets the current session for the specified entity type. /// </summary> /// <param name="entityType"></param> /// <returns></returns> internal static ISession GetCurrentSession(Type entityType) { TableMapping mapping = DataMapper.GetTableMapping(entityType); // Make sure this type has been registered with a session key. if (mapping == null) { return(null); } return(GetCurrentSession(mapping.Key)); }
public QueryBuilder() { Mapping = DataMapper.GetTableMapping(typeof(T)); this.SelectStr = Mapping.SelectExpression; }
/// <summary> /// Gets the database session key for the specified entity type. /// </summary> /// <param name="entityType"></param> /// <returns></returns> internal static string GetSessionKey(Type entityType) { TableMapping mapping = DataMapper.GetTableMapping(entityType); return((mapping == null) ? null : mapping.Key); }