Esempio n. 1
0
        public static IEnumerable <T> Query <T>(this DbContext db,
                                                IQueryable <T> query, IModelInfoProvider infoProvider, IDbObjectFactory factory)
        {
            var executor = LinqExecutorMaker.Make(query, infoProvider, factory, db);
            var result   = executor.Execute();

            return(result);
        }
        public static IEnumerable <T> Query <T>(this DbContext db,
                                                IQueryable <T> query, IModelInfoProvider infoProvider, IDbObjectFactory factory,
                                                AbstractMethodTranslator[] addons = null)
        {
            var executor = LinqExecutorMaker.Make(query, infoProvider, factory, addons);

            var connection = db.Database.GetDbConnection();

            if (connection.State != ConnectionState.Open)
            {
                connection.Open();
            }

            var result = executor.Execute(connection);

            return(result);
        }