Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,23 +1,13 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Linq.Expressions;
using System.Text;
using System.Threading.Tasks;
using System.Linq.Expressions;
using EntityFrameworkCore.Projectables.Services;

namespace EntityFrameworkCore.Projectables.Extensions
{
public static class ExpressionExtensions
{
[Obsolete("Use ExpandProjectables instead")]
public static Expression ExpandQuaryables(this Expression expression)
=> ExpandProjectables(expression);
namespace EntityFrameworkCore.Projectables.Extensions;

/// <summary>
/// Replaces all calls to properties and methods that are marked with the <C>Projectable</C> attribute with their respective expression tree
/// </summary>
public static Expression ExpandProjectables(this Expression expression)
=> new ProjectableExpressionReplacer(new ProjectionExpressionResolver(), false).Replace(expression);
}
}
public static class ExpressionExtensions
{
/// <summary>
/// Replaces all calls to properties and methods that are marked with the <C>Projectable</C> attribute with their respective expression tree
/// </summary>
public static Expression ExpandProjectables(this Expression expression)
=> new ProjectableExpressionReplacer(new ProjectionExpressionResolver(), false).Replace(expression);
}
Original file line number Diff line number Diff line change
@@ -1,22 +1,10 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using EntityFrameworkCore.Projectables.Services;
namespace EntityFrameworkCore.Projectables.Extensions;

namespace EntityFrameworkCore.Projectables.Extensions
public static class QueryableExtensions
{
public static class QueryableExtensions
{
[Obsolete("Use ExpandProjectables instead")]
public static IQueryable<TModel> ExpandQuaryables<TModel>(this IQueryable<TModel> query)
=> ExpandProjectables(query);

/// <summary>
/// Replaces all calls to properties and methods that are marked with the <C>Projectable</C> attribute with their respective expression tree
/// </summary>
public static IQueryable<TModel> ExpandProjectables<TModel>(this IQueryable<TModel> query)
=> query.Provider.CreateQuery<TModel>(query.Expression.ExpandProjectables());
}
}
/// <summary>
/// Replaces all calls to properties and methods that are marked with the <C>Projectable</C> attribute with their respective expression tree
/// </summary>
public static IQueryable<TModel> ExpandProjectables<TModel>(this IQueryable<TModel> query)
=> query.Provider.CreateQuery<TModel>(query.Expression.ExpandProjectables());
}