示例#1
0
 /// <summary>
 /// Converts an <see cref="ISqlSelect{T}"/> to an EFCore <see cref="IQueryable{T}"/>, where the query type doesn't needs to be a <see cref="DbSet{TEntity}"/>
 /// of the context but it should be registered in the model as a query type
 /// </summary>
 public static IQueryable <T> ToIQueryable <T>(this ISqlSelect <T> select, DbContext context)
     where T : class
 {
     return(select.ExecuteIQueryable(context.Query <T>()).AsNoTracking());
 }
示例#2
0
 /// <summary>
 /// Converts an <see cref="ISqlSelect{T}"/> to an EFCore <see cref="IQueryable{T}"/> related to the given <see cref="DbSet{TEntity}"/>
 /// </summary>
 public static IQueryable <T> ToIQueryableSet <T, TDbSet>(this ISqlSelect <T> select, DbSet <T> set)
     where T : class
 {
     return(select.ExecuteIQueryable(set));
 }