/// <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()); }
/// <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)); }