Ejemplo n.º 1
0
        /// <summary>
        /// Gets the query.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="collection">The collection.</param>
        /// <param name="selector">The selector.</param>
        /// <returns></returns>
        private static ISequoiaQuery GetQuery <T>(DBCollection <T> collection, Expression <Func <T, bool> > selector) where T : class
        {
            var query      = collection.AsQueryable <T>().Where(selector);
            var mongoQuery = ((SequoiaQueryable <T>)query).GetMongoQuery();

            return(mongoQuery);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// This method gets the IQueryable instances of collection to be used by linq
 /// </summary>
 private void GetIQueryableInstances()
 {
     // Get Extended IQueryable instance to run LINQ write queries
     _prodUpdatable = _productsCollection.AsUpdateable();
     // Get IQueryable instance to run LINQ read queries
     _prodQueryable = _productsCollection.AsQueryable();
 }