Skip to content

Commit 46b67e2

Browse files
committed
Fix the public API warnings
1 parent 74b2c5b commit 46b67e2

File tree

3 files changed

+19
-22
lines changed

3 files changed

+19
-22
lines changed

src/Microsoft.AspNetCore.OData/PublicAPI.Unshipped.txt

-3
Original file line numberDiff line numberDiff line change
@@ -831,7 +831,6 @@ Microsoft.AspNetCore.OData.Query.Expressions.ExpressionBinderBase.EnsureFlattene
831831
Microsoft.AspNetCore.OData.Query.Expressions.ExpressionBinderBase.ExpressionBinderBase(System.IServiceProvider requestContainer) -> void
832832
Microsoft.AspNetCore.OData.Query.Expressions.ExpressionBinderBase.GetDynamicPropertyContainer(Microsoft.OData.UriParser.SingleValueOpenPropertyAccessNode openNode) -> System.Reflection.PropertyInfo
833833
Microsoft.AspNetCore.OData.Query.Expressions.ExpressionBinderBase.GetFlattenedPropertyExpression(string propertyPath) -> System.Linq.Expressions.Expression
834-
Microsoft.AspNetCore.OData.Query.Expressions.ExpressionBinderHelper
835834
Microsoft.AspNetCore.OData.Query.Expressions.FilterBinder
836835
Microsoft.AspNetCore.OData.Query.Expressions.FilterBinder.FilterBinder(System.IServiceProvider requestContainer) -> void
837836
Microsoft.AspNetCore.OData.Query.Expressions.ISelectExpandBinder
@@ -840,8 +839,6 @@ Microsoft.AspNetCore.OData.Query.Expressions.ISelectExpandBinder.Bind(System.Lin
840839
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinder
841840
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinder.SelectExpandBinder() -> void
842841
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext
843-
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.QueryContext.get -> Microsoft.AspNetCore.OData.Query.ODataQueryContext
844-
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.QueryContext.set -> void
845842
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.QuerySettings.get -> Microsoft.AspNetCore.OData.Query.ODataQuerySettings
846843
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.QuerySettings.set -> void
847844
Microsoft.AspNetCore.OData.Query.Expressions.SelectExpandBinderContext.SelectExpandBinderContext() -> void

src/Microsoft.AspNetCore.OData/Query/Expressions/SelectExpandBinder.cs

+3-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ internal Expression ProjectAsWrapper(SelectExpandBinderContext context, Expressi
111111
}
112112
}
113113

114-
internal Expression CreatePropertyNameExpression(SelectExpandBinderContext context, IEdmStructuredType elementType, IEdmProperty property, Expression source)
114+
internal static Expression CreatePropertyNameExpression(SelectExpandBinderContext context, IEdmStructuredType elementType, IEdmProperty property, Expression source)
115115
{
116116
Contract.Assert(elementType != null);
117117
Contract.Assert(property != null);
@@ -146,7 +146,7 @@ internal Expression CreatePropertyNameExpression(SelectExpandBinderContext conte
146146
return Expression.Constant(property.Name);
147147
}
148148

149-
internal Expression CreatePropertyValueExpression(SelectExpandBinderContext context, IEdmStructuredType elementType, IEdmProperty property, Expression source, FilterClause filterClause)
149+
internal static Expression CreatePropertyValueExpression(SelectExpandBinderContext context, IEdmStructuredType elementType, IEdmProperty property, Expression source, FilterClause filterClause)
150150
{
151151
Contract.Assert(elementType != null);
152152
Contract.Assert(property != null);
@@ -944,7 +944,7 @@ private static Expression GetNullCheckExpression(IEdmStructuralProperty property
944944
return null;
945945
}
946946

947-
private Expression GetNullCheckExpression(SelectExpandBinderContext context, IEdmNavigationProperty propertyToExpand, Expression propertyValue,
947+
private static Expression GetNullCheckExpression(SelectExpandBinderContext context, IEdmNavigationProperty propertyToExpand, Expression propertyValue,
948948
SelectExpandClause projection)
949949
{
950950
if (projection == null || propertyToExpand.Type.IsCollection())

test/Microsoft.AspNetCore.OData.Tests/Query/Expressions/SelectExpandBinderTest.cs

+16-16
Original file line numberDiff line numberDiff line change
@@ -1357,25 +1357,25 @@ public void CreatePropertyNameExpression_ReturnsCorrectExpression()
13571357

13581358
// Act & Assert
13591359
// #1. Base property on base type
1360-
Expression property = binder.CreatePropertyNameExpression(_selectExpandBinderContext, _customer, baseProperty, source);
1360+
Expression property = SelectExpandBinder.CreatePropertyNameExpression(_selectExpandBinderContext, _customer, baseProperty, source);
13611361
Assert.Equal(ExpressionType.Constant, property.NodeType);
13621362
Assert.Equal(typeof(string), property.Type);
13631363
Assert.Equal("PrivateOrder", (property as ConstantExpression).Value);
13641364

13651365
// #2. Base property on derived type
1366-
property = binder.CreatePropertyNameExpression(_selectExpandBinderContext, vipCustomer, baseProperty, source);
1366+
property = SelectExpandBinder.CreatePropertyNameExpression(_selectExpandBinderContext, vipCustomer, baseProperty, source);
13671367
Assert.Equal(ExpressionType.Constant, property.NodeType);
13681368
Assert.Equal(typeof(string), property.Type);
13691369
Assert.Equal("PrivateOrder", (property as ConstantExpression).Value);
13701370

13711371
// #3. Derived property on base type
1372-
property = binder.CreatePropertyNameExpression(_selectExpandBinderContext, _customer, derivedProperty, source);
1372+
property = SelectExpandBinder.CreatePropertyNameExpression(_selectExpandBinderContext, _customer, derivedProperty, source);
13731373
Assert.Equal(ExpressionType.Conditional, property.NodeType);
13741374
Assert.Equal(typeof(string), property.Type);
13751375
Assert.Equal("IIF((aCustomer Is QueryVipCustomer), \"Birthday\", null)", property.ToString());
13761376

13771377
// #4. Derived property on derived type.
1378-
property = binder.CreatePropertyNameExpression(_selectExpandBinderContext, vipCustomer, derivedProperty, source);
1378+
property = SelectExpandBinder.CreatePropertyNameExpression(_selectExpandBinderContext, vipCustomer, derivedProperty, source);
13791379
Assert.Equal(ExpressionType.Constant, property.NodeType);
13801380
Assert.Equal(typeof(string), property.Type);
13811381
Assert.Equal("Birthday", (property as ConstantExpression).Value);
@@ -1394,7 +1394,7 @@ public void CreatePropertyNameExpression_ReturnsConstantExpression_IfPropertyTyp
13941394
Expression source = Expression.Parameter(typeof(QueryCustomer), "aCustomer");
13951395

13961396
// Act
1397-
Expression property = _binder.CreatePropertyNameExpression(_selectExpandBinderContext, _customer, edmProperty, source);
1397+
Expression property = SelectExpandBinder.CreatePropertyNameExpression(_selectExpandBinderContext, _customer, edmProperty, source);
13981398

13991399
// Assert
14001400
Assert.Equal(ExpressionType.Constant, property.NodeType);
@@ -1417,7 +1417,7 @@ public void CreatePropertyNameExpression_ThrowsODataException_IfMappingTypeIsNot
14171417
SelectExpandBinder binder = GetBinder<QueryCustomer>(model);
14181418

14191419
// Act & Assert
1420-
ExceptionAssert.Throws<ODataException>(() => binder.CreatePropertyNameExpression(_selectExpandBinderContext, _customer, subNameProperty, source),
1420+
ExceptionAssert.Throws<ODataException>(() => SelectExpandBinder.CreatePropertyNameExpression(_selectExpandBinderContext, _customer, subNameProperty, source),
14211421
"The provided mapping does not contain a resource for the resource type 'NS.SubCustomer'.");
14221422
}
14231423
#endregion
@@ -1435,7 +1435,7 @@ public void CreatePropertyValueExpression_NonDerivedNavigationProperty_ReturnsMe
14351435
Assert.NotNull(navProperty);
14361436

14371437
// Act
1438-
Expression propertyValue = _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, navProperty, source, null);
1438+
Expression propertyValue = SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, navProperty, source, null);
14391439

14401440
// Assert
14411441
Assert.Equal(ExpressionType.MemberAccess, propertyValue.NodeType);
@@ -1458,7 +1458,7 @@ public void CreatePropertyValueExpression_DerivedNavigationProperty_ReturnsPrope
14581458
Assert.NotNull(specialProperty);
14591459

14601460
// Act
1461-
Expression propertyValue = _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, specialProperty, source, null);
1461+
Expression propertyValue = SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, specialProperty, source, null);
14621462

14631463
// Assert
14641464
Assert.Equal(String.Format("({0} As QueryVipCustomer).{1}", source.ToString(), property), propertyValue.ToString());
@@ -1480,7 +1480,7 @@ public void CreatePropertyValueExpression_DerivedValueProperty_ReturnsPropertyAc
14801480
Assert.NotNull(vipCustomer);
14811481

14821482
// Act
1483-
Expression propertyValue = _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, edmProperty, source, null);
1483+
Expression propertyValue = SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, edmProperty, source, null);
14841484

14851485
// Assert
14861486
Assert.Equal(String.Format("Convert(({0} As QueryVipCustomer).{1}, Nullable`1)", source.ToString(), property), propertyValue.ToString());
@@ -1502,7 +1502,7 @@ public void CreatePropertyValueExpression_DerivedReferenceProperty_ReturnsProper
15021502
Assert.NotNull(vipCustomer);
15031503

15041504
// Act
1505-
Expression propertyValue = _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, edmProperty, source, null);
1505+
Expression propertyValue = SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, edmProperty, source, null);
15061506

15071507
// Assert
15081508
Assert.Equal(String.Format("({0} As QueryVipCustomer).{1}", source.ToString(), property), propertyValue.ToString());
@@ -1517,7 +1517,7 @@ public void CreatePropertyValueExpression_HandleNullPropagationTrue_AddsNullChec
15171517
IEdmProperty idProperty = _customer.StructuralProperties().Single(p => p.Name == "Id");
15181518

15191519
// Act
1520-
Expression property = _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, idProperty, source, null);
1520+
Expression property = SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, idProperty, source, null);
15211521

15221522
// Assert
15231523
// NetFx and NetCore differ in the way Expression is converted to a string.
@@ -1554,7 +1554,7 @@ public void CreatePropertyValueExpression_HandleNullPropagationFalse_ConvertsToN
15541554
IEdmProperty idProperty = _customer.StructuralProperties().Single(p => p.Name == "Id");
15551555

15561556
// Act
1557-
Expression property = _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, idProperty, source, filterClause: null);
1557+
Expression property = SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, idProperty, source, filterClause: null);
15581558

15591559
// Assert
15601560
Assert.Equal(String.Format("Convert({0}.Id, Nullable`1)", source.ToString()), property.ToString());
@@ -1587,7 +1587,7 @@ public void CreatePropertyValueExpression_Collection_ThrowsODataException_IfMapp
15871587

15881588
// Act & Assert
15891589
ExceptionAssert.Throws<ODataException>(
1590-
() => _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, ordersProperty, source, expandItem.FilterOption),
1590+
() => SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, ordersProperty, source, expandItem.FilterOption),
15911591
String.Format("The provided mapping does not contain a resource for the resource type '{0}'.",
15921592
ordersProperty.Type.Definition.AsElementType().FullTypeName()));
15931593
}
@@ -1616,7 +1616,7 @@ public void CreatePropertyValueExpression_Collection_Works_HandleNullPropagation
16161616
Assert.NotNull(expandItem.FilterOption);
16171617

16181618
// Act
1619-
var filterInExpand = _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, ordersProperty, source, expandItem.FilterOption);
1619+
var filterInExpand = SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _customer, ordersProperty, source, expandItem.FilterOption);
16201620

16211621
// Assert
16221622
if (nullOption == HandleNullPropagationOption.True)
@@ -1691,7 +1691,7 @@ public void CreatePropertyValueExpression_Single_Works_IfSettingIsOff()
16911691
Assert.NotNull(expandItem.FilterOption);
16921692

16931693
// Act
1694-
var filterInExpand = _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _order, customerProperty, order, expandItem.FilterOption);
1694+
var filterInExpand = SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _order, customerProperty, order, expandItem.FilterOption);
16951695

16961696
// Assert
16971697
var customer = Expression.Lambda(filterInExpand).Compile().DynamicInvoke() as QueryCustomer;
@@ -1725,7 +1725,7 @@ public void CreatePropertyValueExpression_Single_Works_HandleNullPropagationOpti
17251725
Assert.NotNull(expandItem.FilterOption);
17261726

17271727
// Act
1728-
var filterInExpand = _binder.CreatePropertyValueExpression(_selectExpandBinderContext, _order, customerProperty, source, expandItem.FilterOption);
1728+
var filterInExpand = SelectExpandBinder.CreatePropertyValueExpression(_selectExpandBinderContext, _order, customerProperty, source, expandItem.FilterOption);
17291729

17301730
// Assert
17311731
if (nullOption == HandleNullPropagationOption.True)

0 commit comments

Comments
 (0)