Skip to content

Commit

Permalink
Rename SelectExpandQuery to SelectExpand in SelectExpandBinderContext
Browse files Browse the repository at this point in the history
  • Loading branch information
xuzhg committed Nov 8, 2021
1 parent 1b26be5 commit f08915b
Show file tree
Hide file tree
Showing 8 changed files with 31 additions and 33 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8707,7 +8707,7 @@
Gets or sets the <see cref="T:Microsoft.AspNetCore.OData.Query.ODataQuerySettings"/> that contains all the query application related settings.
</summary>
</member>
<member name="P:Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.SelectExpandQuery">
<member name="P:Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.SelectExpand">
<summary>
Gets or sets the <see cref="T:Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption"/> which contains the $select and $expand query options.
</summary>
Expand Down
4 changes: 2 additions & 2 deletions src/Microsoft.AspNetCore.OData/PublicAPI.Unshipped.txt
Original file line number Diff line number Diff line change
Expand Up @@ -850,9 +850,9 @@ Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinder.SelectExpandBind
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.QuerySettings.get -> Microsoft.AspNetCore.OData.Query.ODataQuerySettings
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.QuerySettings.set -> void
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.SelectExpand.get -> Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.SelectExpand.set -> void
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.SelectExpandBinderContext() -> void
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.SelectExpandQuery.get -> Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.SelectExpandQuery.set -> void
Microsoft.AspNetCore.OData.Query.FilterQueryOption
Microsoft.AspNetCore.OData.Query.FilterQueryOption.ApplyTo(System.Linq.IQueryable query, Microsoft.AspNetCore.OData.Query.ODataQuerySettings querySettings) -> System.Linq.IQueryable
Microsoft.AspNetCore.OData.Query.FilterQueryOption.Context.get -> Microsoft.AspNetCore.OData.Query.ODataQueryContext
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,13 @@ public virtual IQueryable Bind(IQueryable source, SelectExpandBinderContext cont
{
Contract.Assert(source != null);
Contract.Assert(context != null);
Contract.Assert(context.SelectExpandQuery != null);
Contract.Assert(context.SelectExpandQuery.Context != null);
Contract.Assert(context.SelectExpandQuery.Context.Model != null);
Contract.Assert(context.SelectExpand != null);
Contract.Assert(context.SelectExpand.Context != null);
Contract.Assert(context.SelectExpand.Context.Model != null);
Contract.Assert(context.QuerySettings != null);
Contract.Assert(context.QuerySettings.HandleNullPropagation != HandleNullPropagationOption.Default);

Type elementType = context.SelectExpandQuery.Context.ElementClrType;
Type elementType = context.SelectExpand.Context.ElementClrType;

LambdaExpression projectionLambda = GetProjectionLambda(context);

Expand All @@ -53,9 +53,9 @@ public virtual object Bind(object source, SelectExpandBinderContext context)
{
Contract.Assert(source != null);
Contract.Assert(context != null);
Contract.Assert(context.SelectExpandQuery != null);
Contract.Assert(context.SelectExpandQuery.Context != null);
Contract.Assert(context.SelectExpandQuery.Context.Model != null);
Contract.Assert(context.SelectExpand != null);
Contract.Assert(context.SelectExpand.Context != null);
Contract.Assert(context.SelectExpand.Context.Model != null);
Contract.Assert(context.QuerySettings != null);
Contract.Assert(context.QuerySettings.HandleNullPropagation != HandleNullPropagationOption.Default);

Expand All @@ -74,10 +74,10 @@ public virtual object Bind(object source, SelectExpandBinderContext context)
protected virtual LambdaExpression GetProjectionLambda(SelectExpandBinderContext context)
{
Contract.Assert(context != null);
Type elementType = context.SelectExpandQuery.Context.ElementClrType;
IEdmStructuredType structuredType = context.SelectExpandQuery.Context.ElementType as IEdmStructuredType;
IEdmNavigationSource navigationSource = context.SelectExpandQuery.Context.NavigationSource;
SelectExpandClause selectExpandClause = context.SelectExpandQuery.SelectExpandClause;
Type elementType = context.SelectExpand.Context.ElementClrType;
IEdmStructuredType structuredType = context.SelectExpand.Context.ElementType as IEdmStructuredType;
IEdmNavigationSource navigationSource = context.SelectExpand.Context.NavigationSource;
SelectExpandClause selectExpandClause = context.SelectExpand.SelectExpandClause;
ParameterExpression source = Expression.Parameter(elementType, "$it");

// expression looks like -> new Wrapper { Instance = source , Properties = "...", Container = new PropertyContainer { ... } }
Expand Down Expand Up @@ -118,7 +118,7 @@ internal static Expression CreatePropertyNameExpression(SelectExpandBinderContex
Contract.Assert(source != null);

IEdmStructuredType declaringType = property.DeclaringType;
IEdmModel model = context.SelectExpandQuery.Context.Model;
IEdmModel model = context.SelectExpand.Context.Model;

// derived property using cast
if (elementType != declaringType)
Expand Down Expand Up @@ -152,8 +152,8 @@ internal static Expression CreatePropertyValueExpression(SelectExpandBinderConte
Contract.Assert(property != null);
Contract.Assert(source != null);

IEdmModel model = context.SelectExpandQuery.Context.Model;
ODataQueryContext queryContext = context.SelectExpandQuery.Context;
IEdmModel model = context.SelectExpand.Context.Model;
ODataQueryContext queryContext = context.SelectExpand.Context;
ODataQuerySettings settings = context.QuerySettings;

// Expression: source = source as propertyDeclaringType
Expand Down Expand Up @@ -267,7 +267,7 @@ internal Expression ProjectElement(SelectExpandBinderContext context, Expression
{
Contract.Assert(source != null);

IEdmModel model = context.SelectExpandQuery.Context.Model;
IEdmModel model = context.SelectExpand.Context.Model;

// If it's not a structural type, just return the source.
if (structuredType == null)
Expand Down Expand Up @@ -697,7 +697,7 @@ internal void BuildExpandedProperty(SelectExpandBinderContext context, Expressio
Contract.Assert(includedProperties != null);

IEdmEntityType edmEntityType = navigationProperty.ToEntityType();
IEdmModel model = context.SelectExpandQuery.Context.Model;
IEdmModel model = context.SelectExpand.Context.Model;
ODataQuerySettings settings = context.QuerySettings;

ModelBoundQuerySettings querySettings = model.GetModelBoundQuerySettings(navigationProperty, edmEntityType);
Expand Down Expand Up @@ -774,7 +774,7 @@ internal void BuildSelectedProperty(SelectExpandBinderContext context, Expressio
Contract.Assert(structuralProperty != null);
Contract.Assert(includedProperties != null);

IEdmModel model = context.SelectExpandQuery.Context.Model;
IEdmModel model = context.SelectExpand.Context.Model;
ODataQuerySettings settings = context.QuerySettings;

// // Expression:
Expand Down Expand Up @@ -864,7 +864,7 @@ internal static void BuildDynamicProperty(SelectExpandBinderContext context, Exp
Contract.Assert(structuredType != null);
Contract.Assert(includedProperties != null);

IEdmModel model = context.SelectExpandQuery.Context.Model;
IEdmModel model = context.SelectExpand.Context.Model;
ODataQuerySettings settings = context.QuerySettings;

PropertyInfo dynamicPropertyDictionary = model.GetDynamicPropertyDictionary(structuredType);
Expand Down Expand Up @@ -920,7 +920,7 @@ private static Expression AddOrderByQueryForSource(SelectExpandBinderContext con
};

LambdaExpression orderByExpression =
FilterBinder.Bind(null, orderbyClause, elementType, context.SelectExpandQuery.Context, querySettings);
FilterBinder.Bind(null, orderbyClause, elementType, context.SelectExpand.Context, querySettings);
source = ExpressionHelpers.OrderBy(source, orderByExpression, elementType, orderbyClause.Direction);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@
// </copyright>
//------------------------------------------------------------------------------

using Microsoft.OData.Edm;

namespace Microsoft.AspNetCore.OData.Query.Expressions
{
/// <summary>
Expand All @@ -22,6 +20,6 @@ public class SelectExpandBinderContext
/// <summary>
/// Gets or sets the <see cref="SelectExpandQueryOption"/> which contains the $select and $expand query options.
/// </summary>
public SelectExpandQueryOption SelectExpandQuery { get; set; }
public SelectExpandQueryOption SelectExpand { get; set; }
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -212,7 +212,7 @@ public IQueryable ApplyTo(IQueryable queryable, ODataQuerySettings settings)

SelectExpandBinderContext selectExpandBinderContext = new SelectExpandBinderContext()
{
SelectExpandQuery = this,
SelectExpand = this,
QuerySettings = updatedSettings
};

Expand Down Expand Up @@ -246,7 +246,7 @@ public object ApplyTo(object entity, ODataQuerySettings settings)

SelectExpandBinderContext selectExpandBinderContext = new SelectExpandBinderContext()
{
SelectExpandQuery = this,
SelectExpand = this,
QuerySettings = updatedSettings
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2578,7 +2578,7 @@ public class Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderCont
public SelectExpandBinderContext ()

Microsoft.AspNetCore.OData.Query.ODataQuerySettings QuerySettings { public get; public set; }
Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption SelectExpandQuery { public get; public set; }
Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption SelectExpand { public get; public set; }
}

public class Microsoft.AspNetCore.OData.Query.Validator.CountQueryValidator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2578,7 +2578,7 @@ public class Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderCont
public SelectExpandBinderContext ()

Microsoft.AspNetCore.OData.Query.ODataQuerySettings QuerySettings { public get; public set; }
Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption SelectExpandQuery { public get; public set; }
Microsoft.AspNetCore.OData.Query.SelectExpandQueryOption SelectExpand { public get; public set; }
}

public class Microsoft.AspNetCore.OData.Query.Validator.CountQueryValidator {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ public SelectExpandBinderTest()
SelectExpandQueryOption selectExpandQueryOption = new SelectExpandQueryOption("Orders", expand: null, context: _context);
_selectExpandBinderContext = new SelectExpandBinderContext()
{
SelectExpandQuery = selectExpandQueryOption,
SelectExpand = selectExpandQueryOption,
QuerySettings = _settings
};
}
Expand Down Expand Up @@ -100,7 +100,7 @@ public void Bind_ReturnsIEdmObject_WithRightEdmType(string select)
// Act
SelectExpandBinderContext selectExpandBinderContext = new SelectExpandBinderContext()
{
SelectExpandQuery = selectExpand,
SelectExpand = selectExpand,
QuerySettings = _settings
};

Expand All @@ -124,7 +124,7 @@ public void Bind_GeneratedExpression_ContainsExpandedObject()
// Act
SelectExpandBinderContext selectExpandBinderContext = new SelectExpandBinderContext()
{
SelectExpandQuery = selectExpand,
SelectExpand = selectExpand,
QuerySettings = _settings
};

Expand Down Expand Up @@ -157,7 +157,7 @@ public void Bind_GeneratedExpression_CheckNullObjectWithinChainProjectionByKey()
// Act
SelectExpandBinderContext selectExpandBinderContext = new SelectExpandBinderContext()
{
SelectExpandQuery = selectExpand,
SelectExpand = selectExpand,
QuerySettings = _settings
};

Expand Down

0 comments on commit f08915b

Please sign in to comment.