Exemplo n.º 1
0
        public EntityQueryBuilder(ISession session)
        {
            Guard.ArgumentNotNull(session, nameof(session));

            // ReSharper disable once UsePatternMatching
            var sqlException = session as Session;

            if (sqlException != null)
            {
                var sqlGeneratorImpl = new SqlGeneratorImpl(sqlException.Configuration);

                _dapperImplementation = new DapperImplementor(sqlGeneratorImpl);
            }
            else
            {
                throw new InvalidOperationException("ISession is not a Session type.");
            }

            _dapperSession = new DapperSession(sqlException.GetConnection());
        }
Exemplo n.º 2
0
 public BaseRepository()
 {
     _dbSession = DapperSession.DbSession;
 }