/// <summary>
 /// This is the entry point of Linq to db4o.
 /// It allows the compiler to call the standard query operators
 /// in <see cref="Db4objects.Db4o.Linq.IDb4oLinqQuery">IDb4oLinqQuery</see>. The optimized methods are defined as extension methods
 /// on the <see cref="Db4objects.Db4o.Linq.IDb4oLinqQuery">IDb4oLinqQuery</see> marker interface.
 /// </summary>
 /// <typeparam name="T">The type to query the ObjectContainer</typeparam>
 /// <param name="self">A query factory (any IObjectContainer implementation)</param>
 /// <returns>A <see cref="Db4objects.Db4o.Linq.IDb4oLinqQuery">IDb4oLinqQuery</see> marker interface</returns>
 public static IDb4oLinqQuery <T> Cast <T>(this ISodaQueryFactory queryFactory)
 {
     if (typeof(T) == typeof(object))
     {
         return(new PlaceHolderQuery <T>(queryFactory));
     }
     return(new Db4oQuery <T>(queryFactory));
 }
Ejemplo n.º 2
0
 public Db4oQuery(ISodaQueryFactory queryFactory)
 {
     if (queryFactory == null)
     {
         throw new ArgumentNullException("queryFactory");
     }
     _queryFactory = queryFactory;
     _record       = NullQueryBuilderRecord.Instance;
 }
Ejemplo n.º 3
0
 public Db4oQuery(Db4oQuery <T> parent, IQueryBuilderRecord record)
 {
     _queryFactory = parent.QueryFactory;
     _record       = new CompositeQueryBuilderRecord(parent.Record, record);
 }
Ejemplo n.º 4
0
 public PlaceHolderQuery(ISodaQueryFactory queryFactory)
 {
     QueryFactory = queryFactory;
 }
 public static IDb4oLinqQueryable <T> AsQueryable <T>(this ISodaQueryFactory queryFactory)
 {
     return(queryFactory.Cast <T>().AsQueryable());
 }