Exemplo n.º 1
0
        private IList <T> ReadEntities <T>(DbCommand command, SqlQuery sqlQuery) where T : new()
        {
            var resultSet = _dbCommandExecutor.ExecuteQuery(command, ConnectionString);

            if (sqlQuery.ObjectRelations.Any())
            {
                return(_entityMapper.CreateInstanceGraphs <T>(resultSet, sqlQuery.ObjectRelations, sqlQuery.PrimaryAlias));
            }

            return(_entityMapper.CreateInstanceGraphs <T>(resultSet));
        }
Exemplo n.º 2
0
        public IList <T> Find <T>(SqlQuery sqlQuery)
        {
            var resultSet = FindResultSet <T>(sqlQuery);

            if (sqlQuery.ObjectRelations.Any())
            {
                return(EntityMapper.CreateInstanceGraphs <T>(resultSet, sqlQuery.ObjectRelations, sqlQuery.PrimaryAlias));
            }

            return(EntityMapper.CreateInstanceGraphs <T>(resultSet));
        }