Skip to content

Commit 099a84e

Browse files
committed
Upgrade to ODL v6.9. Thanks.
1 parent 6b6ed43 commit 099a84e

File tree

6 files changed

+64
-18
lines changed

6 files changed

+64
-18
lines changed

OData/src/System.Web.OData/System.Web.OData.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,17 +12,17 @@
1212
<DefineConstants>$(DefineConstants);ASPNETODATA;ASPNETWEBAPI</DefineConstants>
1313
</PropertyGroup>
1414
<ItemGroup>
15-
<Reference Include="Microsoft.OData.Core, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
15+
<Reference Include="Microsoft.OData.Core, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
1616
<SpecificVersion>False</SpecificVersion>
17-
<HintPath>..\..\packages\Microsoft.OData.Core.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
17+
<HintPath>..\..\packages\Microsoft.OData.Core.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
1818
</Reference>
19-
<Reference Include="Microsoft.OData.Edm, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
19+
<Reference Include="Microsoft.OData.Edm, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
2020
<SpecificVersion>False</SpecificVersion>
21-
<HintPath>..\..\packages\Microsoft.OData.Edm.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
21+
<HintPath>..\..\packages\Microsoft.OData.Edm.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
2222
</Reference>
23-
<Reference Include="Microsoft.Spatial, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
23+
<Reference Include="Microsoft.Spatial, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
2424
<SpecificVersion>False</SpecificVersion>
25-
<HintPath>..\..\packages\Microsoft.Spatial.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
25+
<HintPath>..\..\packages\Microsoft.Spatial.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
2626
</Reference>
2727
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
2828
<SpecificVersion>False</SpecificVersion>

OData/src/System.Web.OData/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<packages>
33
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.2" targetFramework="net45" />
44
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.2" targetFramework="net45" />
5-
<package id="Microsoft.OData.Core" version="6.8.1" targetFramework="net45" />
6-
<package id="Microsoft.OData.Edm" version="6.8.1" targetFramework="net45" />
7-
<package id="Microsoft.Spatial" version="6.8.1" targetFramework="net45" />
5+
<package id="Microsoft.OData.Core" version="6.9.0" targetFramework="net45" />
6+
<package id="Microsoft.OData.Edm" version="6.9.0" targetFramework="net45" />
7+
<package id="Microsoft.Spatial" version="6.9.0" targetFramework="net45" />
88
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
99
</packages>

OData/test/System.Web.OData.Test/OData/Routing/DefaultODataPathHandlerTest.cs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1241,6 +1241,44 @@ private object GetParameterValue(object value, Type type)
12411241
return functionSegment.GetParameterValue("Parameter");
12421242
}
12431243

1244+
[Fact]
1245+
public void CanParse_ComplexTypeAsFunctionParameter_ParametersAlias()
1246+
{
1247+
// Arrange
1248+
string complexAlias = "{\"@odata.type\":\"System.Web.OData.Routing.Address\",\"Street\":\"NE 24th St.\",\"City\":\"Redmond\"}";
1249+
1250+
// Act
1251+
ODataPath path = _parser.Parse(_model, _serviceRoot,
1252+
"RoutingCustomers(1)/Default.CanMoveToAddress(address=@address)?@address=" + complexAlias);
1253+
1254+
// Assert
1255+
Assert.Equal("~/entityset/key/function", path.PathTemplate);
1256+
BoundFunctionPathSegment functionSegment = (BoundFunctionPathSegment)path.Segments.Last();
1257+
1258+
object parameterValue = functionSegment.GetParameterValue("address");
1259+
ODataComplexValue address = Assert.IsType<ODataComplexValue>(parameterValue);
1260+
Assert.Equal("System.Web.OData.Routing.Address", address.TypeName);
1261+
}
1262+
1263+
[Fact]
1264+
public void CanParse_CollectionOfComplexTypeAsFunctionParameter_ParametersAlias()
1265+
{
1266+
// Arrange
1267+
string complexAlias = "[{\"Street\":\"NE 24th St.\",\"City\":\"Redmond\"},{\"Street\":\"Pine St.\",\"City\":\"Seattle\"}]";
1268+
1269+
// Act
1270+
ODataPath path = _parser.Parse(_model, _serviceRoot,
1271+
"RoutingCustomers(1)/Default.MoveToAddresses(addresses=@addresses)?@addresses=" + complexAlias);
1272+
1273+
// Assert
1274+
Assert.Equal("~/entityset/key/function", path.PathTemplate);
1275+
BoundFunctionPathSegment functionSegment = (BoundFunctionPathSegment)path.Segments.Last();
1276+
1277+
object parameterValue = functionSegment.GetParameterValue("addresses");
1278+
ODataCollectionValue addresses = Assert.IsType<ODataCollectionValue>(parameterValue);
1279+
Assert.Equal("Collection(System.Web.OData.Routing.Address)", addresses.TypeName);
1280+
}
1281+
12441282
[Theory]
12451283
[InlineData("unBoundWithoutParams", 1, "Edm.Boolean", "~/unboundfunction")]
12461284
[InlineData("unBoundWithoutParams()", 1, "Edm.Boolean", "~/unboundfunction")]

OData/test/System.Web.OData.Test/OData/Routing/ODataRoutingModel.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,14 @@ public static IEdmModel GetModel()
187187
overloadUnboundFunction.Parameter<int>("P2");
188188
overloadUnboundFunction.Parameter<string>("P3");
189189

190+
var functionWithComplexTypeParameter =
191+
builder.EntityType<RoutingCustomer>().Function("CanMoveToAddress").Returns<bool>();
192+
functionWithComplexTypeParameter.Parameter<Address>("address");
193+
194+
var functionWithCollectionOfComplexTypeParameter =
195+
builder.EntityType<RoutingCustomer>().Function("MoveToAddresses").Returns<bool>();
196+
functionWithCollectionOfComplexTypeParameter.CollectionParameter<Address>("addresses");
197+
190198
return builder.GetEdmModel();
191199
}
192200

OData/test/System.Web.OData.Test/System.Web.OData.Test.csproj

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,17 @@
1111
</PropertyGroup>
1212
<ItemGroup>
1313
<Reference Include="Microsoft.CSharp" />
14-
<Reference Include="Microsoft.OData.Core, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
14+
<Reference Include="Microsoft.OData.Core, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
1515
<SpecificVersion>False</SpecificVersion>
16-
<HintPath>..\..\packages\Microsoft.OData.Core.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
16+
<HintPath>..\..\packages\Microsoft.OData.Core.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
1717
</Reference>
18-
<Reference Include="Microsoft.OData.Edm, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
18+
<Reference Include="Microsoft.OData.Edm, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
1919
<SpecificVersion>False</SpecificVersion>
20-
<HintPath>..\..\packages\Microsoft.OData.Edm.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
20+
<HintPath>..\..\packages\Microsoft.OData.Edm.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
2121
</Reference>
22-
<Reference Include="Microsoft.Spatial, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
22+
<Reference Include="Microsoft.Spatial, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
2323
<SpecificVersion>False</SpecificVersion>
24-
<HintPath>..\..\packages\Microsoft.Spatial.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
24+
<HintPath>..\..\packages\Microsoft.Spatial.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
2525
</Reference>
2626
<Reference Include="Moq, Version=4.0.10827.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
2727
<SpecificVersion>False</SpecificVersion>

OData/test/System.Web.OData.Test/packages.config

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@
33
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.2" targetFramework="net45" />
44
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.2" targetFramework="net45" />
55
<package id="Microsoft.AspNet.WebApi.SelfHost" version="5.2.2" targetFramework="net45" />
6-
<package id="Microsoft.OData.Core" version="6.8.1" targetFramework="net45" />
7-
<package id="Microsoft.OData.Edm" version="6.8.1" targetFramework="net45" />
8-
<package id="Microsoft.Spatial" version="6.8.1" targetFramework="net45" />
6+
<package id="Microsoft.OData.Core" version="6.9.0" targetFramework="net45" />
7+
<package id="Microsoft.OData.Edm" version="6.9.0" targetFramework="net45" />
8+
<package id="Microsoft.Spatial" version="6.9.0" targetFramework="net45" />
99
<package id="Moq" version="4.0.10827" targetFramework="net45" />
1010
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
1111
<package id="xunit" version="1.9.1" targetFramework="net45" />

0 commit comments

Comments
 (0)