Upgrade to ODL v6.9. Thanks.
This commit is contained in:
Родитель
6b6ed4387f
Коммит
099a84ed9a
|
@ -12,17 +12,17 @@
|
|||
<DefineConstants>$(DefineConstants);ASPNETODATA;ASPNETWEBAPI</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.OData.Core, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.OData.Core, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.OData.Core.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.OData.Core.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Edm, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.OData.Edm, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.OData.Edm.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.OData.Edm.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Spatial, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.Spatial, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Spatial.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Spatial.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json, Version=6.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
|
|
@ -2,8 +2,8 @@
|
|||
<packages>
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.2" targetFramework="net45" />
|
||||
<package id="Microsoft.OData.Core" version="6.8.1" targetFramework="net45" />
|
||||
<package id="Microsoft.OData.Edm" version="6.8.1" targetFramework="net45" />
|
||||
<package id="Microsoft.Spatial" version="6.8.1" targetFramework="net45" />
|
||||
<package id="Microsoft.OData.Core" version="6.9.0" targetFramework="net45" />
|
||||
<package id="Microsoft.OData.Edm" version="6.9.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Spatial" version="6.9.0" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
|
||||
</packages>
|
|
@ -1241,6 +1241,44 @@ namespace System.Web.OData.Routing
|
|||
return functionSegment.GetParameterValue("Parameter");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanParse_ComplexTypeAsFunctionParameter_ParametersAlias()
|
||||
{
|
||||
// Arrange
|
||||
string complexAlias = "{\"@odata.type\":\"System.Web.OData.Routing.Address\",\"Street\":\"NE 24th St.\",\"City\":\"Redmond\"}";
|
||||
|
||||
// Act
|
||||
ODataPath path = _parser.Parse(_model, _serviceRoot,
|
||||
"RoutingCustomers(1)/Default.CanMoveToAddress(address=@address)?@address=" + complexAlias);
|
||||
|
||||
// Assert
|
||||
Assert.Equal("~/entityset/key/function", path.PathTemplate);
|
||||
BoundFunctionPathSegment functionSegment = (BoundFunctionPathSegment)path.Segments.Last();
|
||||
|
||||
object parameterValue = functionSegment.GetParameterValue("address");
|
||||
ODataComplexValue address = Assert.IsType<ODataComplexValue>(parameterValue);
|
||||
Assert.Equal("System.Web.OData.Routing.Address", address.TypeName);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void CanParse_CollectionOfComplexTypeAsFunctionParameter_ParametersAlias()
|
||||
{
|
||||
// Arrange
|
||||
string complexAlias = "[{\"Street\":\"NE 24th St.\",\"City\":\"Redmond\"},{\"Street\":\"Pine St.\",\"City\":\"Seattle\"}]";
|
||||
|
||||
// Act
|
||||
ODataPath path = _parser.Parse(_model, _serviceRoot,
|
||||
"RoutingCustomers(1)/Default.MoveToAddresses(addresses=@addresses)?@addresses=" + complexAlias);
|
||||
|
||||
// Assert
|
||||
Assert.Equal("~/entityset/key/function", path.PathTemplate);
|
||||
BoundFunctionPathSegment functionSegment = (BoundFunctionPathSegment)path.Segments.Last();
|
||||
|
||||
object parameterValue = functionSegment.GetParameterValue("addresses");
|
||||
ODataCollectionValue addresses = Assert.IsType<ODataCollectionValue>(parameterValue);
|
||||
Assert.Equal("Collection(System.Web.OData.Routing.Address)", addresses.TypeName);
|
||||
}
|
||||
|
||||
[Theory]
|
||||
[InlineData("unBoundWithoutParams", 1, "Edm.Boolean", "~/unboundfunction")]
|
||||
[InlineData("unBoundWithoutParams()", 1, "Edm.Boolean", "~/unboundfunction")]
|
||||
|
|
|
@ -187,6 +187,14 @@ namespace System.Web.OData.Routing
|
|||
overloadUnboundFunction.Parameter<int>("P2");
|
||||
overloadUnboundFunction.Parameter<string>("P3");
|
||||
|
||||
var functionWithComplexTypeParameter =
|
||||
builder.EntityType<RoutingCustomer>().Function("CanMoveToAddress").Returns<bool>();
|
||||
functionWithComplexTypeParameter.Parameter<Address>("address");
|
||||
|
||||
var functionWithCollectionOfComplexTypeParameter =
|
||||
builder.EntityType<RoutingCustomer>().Function("MoveToAddresses").Returns<bool>();
|
||||
functionWithCollectionOfComplexTypeParameter.CollectionParameter<Address>("addresses");
|
||||
|
||||
return builder.GetEdmModel();
|
||||
}
|
||||
|
||||
|
|
|
@ -11,17 +11,17 @@
|
|||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.OData.Core, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.OData.Core, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.OData.Core.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.OData.Core.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.OData.Edm, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.OData.Edm, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.OData.Edm.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.OData.Edm.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.OData.Edm.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Spatial, Version=6.8.1.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Reference Include="Microsoft.Spatial, Version=6.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\packages\Microsoft.Spatial.6.8.1\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
|
||||
<HintPath>..\..\packages\Microsoft.Spatial.6.9.0\lib\portable-net40+sl5+wp8+win8+wpa\Microsoft.Spatial.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Moq, Version=4.0.10827.0, Culture=neutral, PublicKeyToken=69f491c39445e920, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
<package id="Microsoft.AspNet.WebApi.Client" version="5.2.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.2.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.SelfHost" version="5.2.2" targetFramework="net45" />
|
||||
<package id="Microsoft.OData.Core" version="6.8.1" targetFramework="net45" />
|
||||
<package id="Microsoft.OData.Edm" version="6.8.1" targetFramework="net45" />
|
||||
<package id="Microsoft.Spatial" version="6.8.1" targetFramework="net45" />
|
||||
<package id="Microsoft.OData.Core" version="6.9.0" targetFramework="net45" />
|
||||
<package id="Microsoft.OData.Edm" version="6.9.0" targetFramework="net45" />
|
||||
<package id="Microsoft.Spatial" version="6.9.0" targetFramework="net45" />
|
||||
<package id="Moq" version="4.0.10827" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.4" targetFramework="net45" />
|
||||
<package id="xunit" version="1.9.1" targetFramework="net45" />
|
||||
|
|
Загрузка…
Ссылка в новой задаче