Пример #1
0
        /// <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);
            }
        }
Пример #2
0
        /// <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));
        }
Пример #3
0
 public QueryBuilder()
 {
     Mapping        = DataMapper.GetTableMapping(typeof(T));
     this.SelectStr = Mapping.SelectExpression;
 }
Пример #4
0
        /// <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);
        }