/// <summary>
 ///
 /// </summary>
 /// <typeparam name="TEntity"></typeparam>
 /// <param name="dbContext"></param>
 /// <param name="queryString"></param>
 /// <param name="parameters"></param>
 /// <returns></returns>
 public static ObjectQuery <TEntity> CreateQuery <TEntity>(
     this RdbContext dbContext, string queryString, params ObjectParameter[] parameters)
     where TEntity : class
 {
     dbContext.Set <TEntity>();
     return(((IObjectContextAdapter)dbContext).ObjectContext.CreateQuery <TEntity>(queryString, parameters));
 }
Example #2
0
 /// <summary>
 ///
 /// </summary>
 /// <typeparam name="TEntity">实体模型类型参数</typeparam>
 /// <returns></returns>
 public IQueryable <TEntity> Query <TEntity>() where TEntity : class
 {
     return(DbContext.Set <TEntity>());
 }