Ejemplo n.º 1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="BaseRepository{T}"/> class.
        /// </summary>
        /// <param name="sessionFactory">
        /// The session Factory.
        /// </param>
        /// <param name="typeMap">
        /// Mapping information for type T
        /// </param>
        protected BaseRepository(ISessionFactory sessionFactory, BaseClassMap <T> typeMap)
        {
            // NULL-check parameters
            if (sessionFactory == null)
            {
                throw new ArgumentNullException(nameof(sessionFactory));
            }

            if (typeMap == null)
            {
                throw new ArgumentNullException(nameof(typeMap));
            }

            // Set the field values
            this.SessionFactory = sessionFactory;
            this.TypeMap        = typeMap;
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="BaseRepository{T}"/> class.
 /// </summary>
 protected BaseRepository(BaseClassMap <T> typeMap)
     : this(IocContainer.Resolver.Resolve <ISessionFactory>(), typeMap)
 {
 }