diff --git a/.github/CONTRIBUTION.md b/.github/CONTRIBUTION.md index 4b72fe52bd..4d778a378f 100644 --- a/.github/CONTRIBUTION.md +++ b/.github/CONTRIBUTION.md @@ -26,7 +26,7 @@ Pull request of features and bug fixes are both welcomed. Before you send a pull ### Complete a Contribution License Agreement (CLA) You will need to complete a Contributor License Agreement (CLA). Briefly, this agreement testifies that you are granting us permission to use the submitted change according to the terms of the project's license, and that the work being submitted is under appropriate copyright. -Please submit a Contributor License Agreement (CLA) before submitting a pull request. Please fill and submit the [Contribution License Agreement Form | Microsoft](https://cla.microsoft.com/). Be sure to include your GitHub user name along with the agreement. Only after we have received the signed CLA, we'll review the pull request that you send. You only need to do this once for contributing to any Microsoft open source projects. +Please submit a Contributor License Agreement (CLA) before submitting a pull request. Please fill and submit the [Contributor License Agreement](https://cla.dotnetfoundation.org/). Be sure to include your GitHub user name along with the agreement. Only after we have received the signed CLA, we'll review the pull request that you send. This needs to only be done once for any .NET Foundation OSS project. ### Create a new issue on the issue tracker and link the pull request to it You should have an issue created on the [issue tracker](https://github.com/OData/WebApi/issues) before you work on the pull request. After the OData Web API team has reviewed this issue and change its label to "accepting pull request", you can issue a pull request to us in which the link to the related issue is included. diff --git a/License.txt b/License.txt index f83934239a..feef9d0a59 100644 --- a/License.txt +++ b/License.txt @@ -1,6 +1,6 @@ OData-WebAPI -Copyright (c) Microsoft. All rights reserved. +Copyright (c) .NET Foundation and Contributors Material in this repository is made available under the following terms: 1. Code is licensed under the MIT license, reproduced below. @@ -23,4 +23,3 @@ NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPO NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/README.md b/README.md index 20b42d1ad0..e3aa93e68d 100644 --- a/README.md +++ b/README.md @@ -2,8 +2,9 @@ Build | Status --------|--------- +Odata.WebApi Rolling Dotnet pipeline | WebApi Rolling | -WebApi Nightly | +WebApi Nightly | ### Introduction @@ -118,4 +119,10 @@ Please refer to the [How to debug](https://docs.microsoft.com/en-us/odata/webapi ### Code of Conduct -This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments. +This project has adopted the [.NET Foundation Contributor Covenant Code of Conduct](https://dotnetfoundation.org/about/code-of-conduct). For more information see the [Code of Conduct FAQ](https://dotnetfoundation.org/about/faq). + +### .NET Foundation + +This project is supported by the [.NET Foundation](https://dotnetfoundation.org). + +WebApi is a Copyright of © .NET Foundation and other contributors. It is licensed under [MIT License](https://github.com/OData/WebApi/blob/master/License.txt) diff --git a/configs/filelist.txt b/configs/filelist.txt new file mode 100644 index 0000000000..bd76140b74 --- /dev/null +++ b/configs/filelist.txt @@ -0,0 +1 @@ +**/*.dll \ No newline at end of file diff --git a/images/odata.png b/images/odata.png new file mode 100644 index 0000000000..77f9f5706f Binary files /dev/null and b/images/odata.png differ diff --git a/pipelines/azure_pipelines.yml b/pipelines/azure_pipelines.yml new file mode 100644 index 0000000000..b8b4840cf6 --- /dev/null +++ b/pipelines/azure_pipelines.yml @@ -0,0 +1,29 @@ +trigger: + branches: + include: + - master + +resources: + repositories: + - repository: self + type: git + ref: master + +pr: + - master +variables: + BuildPlatform: 'Any Cpu' + BuildConfiguration: 'Release' +stages: +- stage: Build + jobs: + - job: Main + displayName: Main Build + # setting a 3hour timeout as webapi tests normally take about 2hr 30 mins + timeoutInMinutes: 180 + + pool: + vmImage: windows-latest + + steps: + - template: ./common.yml diff --git a/pipelines/azure_pipelines_nightly.yml b/pipelines/azure_pipelines_nightly.yml new file mode 100644 index 0000000000..f91bd4b6ad --- /dev/null +++ b/pipelines/azure_pipelines_nightly.yml @@ -0,0 +1,107 @@ +schedules: +- cron: "0 0 * * *" + displayName: Daily Nightly build + branches: + include: + - master +resources: + repositories: + - repository: self + type: git + ref: master +variables: + BuildPlatform: 'Any Cpu' + BuildConfiguration: 'Release' + RootDir: '$(Build.SourcesDirectory)' + ProductBinPath: '$(RootDir)\bin\$(BuildConfiguration)' + RELEASE_SEMANTICS: '$(ReleaseSemantics)' + SourcesRoot: '$(RootDir)' +stages: +- stage: Build + variables: + - group: SigningConfig + jobs: + - job: Main + displayName: Main Build + # setting a 3hour timeout as webapi tests normally take about 2hr 30 mins + timeoutInMinutes: 180 + pool: + vmImage: windows-latest + steps: + - template: ./common.yml + - task: MSBuild@1 + displayName: 'Get Nuget Package Metadata' + inputs: + solution: tools/GetNugetPackageMetadata.proj + platform: '$(BuildPlatform)' + configuration: '$(BuildConfiguration)' + - pwsh: | + $date = Get-Date + $NightlyBuildVersion = $date.ToString('yyyyMMddHHmm') + echo "##vso[task.setvariable variable=NightlyBuildVersion]$NightlyBuildVersion" + displayName: Generate Nightly Build version + - task: DotNetCoreCLI@2 + displayName: Packing ASP.NET Core OData + inputs: + command: custom + custom: pack + arguments: > + $(RootDir)\src\Microsoft.AspNetCore.OData\Microsoft.AspNetCore.OData.csproj + /p:NuspecFile=$(rootDir)\src\Microsoft.AspNetCore.OData\Microsoft.AspNetCore.OData.$(RELEASE_SEMANTICS).nuspec + --configuration=$(buildConfiguration) + --output=$(Build.ArtifactStagingDirectory)\Packages + -p:IncludeSymbols=true -p:SymbolPackageFormat=snupkg + + - task: NuGetCommand@2 + displayName: 'Packing AspNet.OData' + inputs: + command: custom + arguments: pack $(RootDir)\src\Microsoft.AspNet.OData\Microsoft.AspNet.OData.$(RELEASE_SEMANTICS).nuspec -NonInteractive -OutputDirectory $(Build.ArtifactStagingDirectory)\Packages -Properties Configuration=$(BuildConfiguration);ProductRoot=$(ProductBinPath);SourcesRoot=$(Build.SourcesDirectory);VersionNuGetSemantic=$(VersionNuGetSemantic);NightlyBuildVersion=$(NightlyBuildVersion);AspNetPackageDependency="$(AspNetPackageDependency)";DependencyInjection1PackageDependency="$(DependencyInjection1PackageDependency)";ODataLibPackageDependency="$(ODataLibPackageDependency)" -Verbosity Detailed -Symbols -SymbolPackageFormat snupkg + - publish: $(Build.ArtifactStagingDirectory)\Packages + displayName: Publish Build Artifacts + artifact: BuildPackages + - pwsh: | + $config = "{""SignClient"":{""AzureAd"":{""AADInstance"":""$(AADInstance)"",""ClientId"":""$(ClientId)"",""TenantId"":""$(TenantId)""},""Service"":{""Url"":""https://codesign.dotnetfoundation.org/"",""ResourceId"":""$(ResourceId)""}}}" + $config > .\configs\SignClient.json + displayName: Generate Sign config + - publish: configs + displayName: Publish Signing Scripts + artifact: configs + +- stage: CodeSign + condition: and(succeeded('Build'), not(eq(variables['build.reason'], 'PullRequest'))) + jobs: + - deployment: CodeSign + displayName: Code Signing + pool: + vmImage: windows-latest + environment: Code Sign - Approvals + variables: + - group: Code Signing + strategy: + runOnce: + deploy: + steps: + - task: DotNetCoreCLI@2 + inputs: + command: custom + custom: tool + arguments: install --tool-path . SignClient + displayName: Install SignTool tool + + - pwsh: | + .\SignClient "Sign" ` + --baseDirectory "$(Pipeline.Workspace)\BuildPackages" ` + --input "**/*.nupkg" ` + --config "$(Pipeline.Workspace)\configs\SignClient.json" ` + --filelist "$(Pipeline.Workspace)\configs\filelist.txt" ` + --user "$(SignClientUser)" ` + --secret "$(SignClientSecret)" ` + --name "Code Sign packages" ` + --description "Signing packages" ` + --descriptionUrl "https://github.com/OData/WebApi" + displayName: Sign packages + + - publish: $(Pipeline.Workspace)/BuildPackages + displayName: Publish Signed Packages + artifact: SignedPackages diff --git a/pipelines/common.yml b/pipelines/common.yml new file mode 100644 index 0000000000..d158498172 --- /dev/null +++ b/pipelines/common.yml @@ -0,0 +1,121 @@ +steps: +- checkout: self + +- task: NuGetToolInstaller@1 + displayName: Use NuGet >=5.2.0 + inputs: + versionSpec: '>=5.2.0' + checkLatest: true + +- task: UseDotNet@2 + displayName: Use .NET Core sdk 3.1 + inputs: + version: 3.x + +- task: UseDotNet@2 + displayName: Use .NET Core sdk 2.0.x + inputs: + version: 2.0.x + +- task: UseDotNet@2 + displayName: Use .NET Core sdk 5.x + inputs: + version: 5.x + includePreviewVersions: true + +- task: NuGetCommand@2 + displayName: 'NuGet restore **\*.sln' + inputs: + restoreSolution: 'sln/WebApiOData.AspNet.sln;sln/WebApiOData.AspNetCore.sln;sln/WebApiOData.E2E.AspNet.sln;sln/WebApiOData.E2E.AspNetCore.sln' + +- task: VSBuild@1 + displayName: 'Build solution sln\WebApiOData.AspNet.sln' + inputs: + solution: 'sln\WebApiOData.AspNet.sln ' + platform: '$(BuildPlatform)' + configuration: '$(BuildConfiguration)' + +- task: VSBuild@1 + displayName: 'Build solution sln\WebApiOData.E2E.AspNet.sln' + inputs: + solution: 'sln\WebApiOData.E2E.AspNet.sln' + platform: '$(BuildPlatform)' + configuration: '$(BuildConfiguration)' + +- task: DotNetCoreCLI@2 + displayName: 'Build Microsoft.AspNetCore.OData.csproj ' + inputs: + projects: '$(Build.SourcesDirectory)\src\Microsoft.AspNetCore.OData\Microsoft.AspNetCore.OData.csproj' + arguments: '--configuration $(BuildConfiguration) --no-incremental' + +- task: DotNetCoreCLI@2 + displayName: 'Build .NET Core Unit test project' + inputs: + projects: '$(Build.SourcesDirectory)\test\UnitTest\Microsoft.AspNetCore.OData.Test\Microsoft.AspNetCore.OData.Test.csproj' + arguments: '--configuration $(BuildConfiguration) --no-incremental' + +- task: DotNetCoreCLI@2 + displayName: 'Build .NET Core E2E test project' + inputs: + projects: '$(Build.SourcesDirectory)\test\E2ETest\Microsoft.Test.E2E.AspNet.OData\Build.AspNetCore\Microsoft.Test.E2E.AspNetCore.OData.csproj' + arguments: '--configuration $(BuildConfiguration) --no-incremental' + +- task: DotNetCoreCLI@2 + displayName: 'Build .NET Core 3x E2E test project' + inputs: + projects: '$(Build.SourcesDirectory)\test\E2ETest\Microsoft.Test.E2E.AspNet.OData\Build.AspNetCore3x\Microsoft.Test.E2E.AspNetCore3x.OData.csproj' + arguments: '--configuration $(BuildConfiguration) --no-incremental' + +- powershell: | + $PROGRAMFILESX86 = [Environment]::GetFolderPath("ProgramFilesX86") + + $SN = $PROGRAMFILESX86 + "\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\sn.exe" + $SNx64 = $PROGRAMFILESX86 + "\Microsoft SDKs\Windows\v10.0A\bin\NETFX 4.8 Tools\x64\sn.exe" + + & $SN /Vr $(Build.SourcesDirectory)\bin\Release\Microsoft.AspNet.OData.dll + & $SNx64 /Vr $(Build.SourcesDirectory)\bin\Release\Microsoft.AspNet.OData.dll + + & $SN /Vr $(Build.SourcesDirectory)\bin\release\netstandard2.0\Microsoft.AspNetCore.OData.dll + & $SNx64 /Vr $(Build.SourcesDirectory)\bin\release\netstandard2.0\Microsoft.AspNetCore.OData.dll + + & $SN /Vr $(Build.SourcesDirectory)\bin\Release\UnitTest\AspNet\Microsoft.AspNet.OData.Test.dll + & $SNx64 /Vr $(Build.SourcesDirectory)\bin\Release\UnitTest\AspNet\Microsoft.AspNet.OData.Test.dll + + & $SN /Vr $(Build.SourcesDirectory)\bin\Release\E2ETest\AspNet\Microsoft.Test.E2E.AspNet.OData.dll + & $SNx64 /Vr $(Build.SourcesDirectory)\bin\Release\E2ETest\AspNet\Microsoft.Test.E2E.AspNet.OData.dll + + & $SN /Vr $(Build.SourcesDirectory)\bin\release\E2ETest\AspNetCore\Microsoft.Test.E2E.AspNetCore.OData.dll + & $SNx64 /Vr $(Build.SourcesDirectory)\bin\release\E2ETest\AspNetCore\Microsoft.Test.E2E.AspNetCore.OData.dll + displayName: 'Skip StrongName for Classic' + +- task: DotNetCoreCLI@2 + displayName: 'Core E2E Tests (Microsoft.Test.E2E.AspNetCore.OData.csproj)' + inputs: + command: test + projects: '$(Build.SourcesDirectory)\test\E2ETest\Microsoft.Test.E2E.AspNet.OData\Build.AspNetCore\Microsoft.Test.E2E.AspNetCore.OData.csproj' + arguments: '--configuration $(BuildConfiguration) --no-build' + +- task: DotNetCoreCLI@2 + displayName: 'Core E2E 3x Tests (Microsoft.Test.E2E.AspNetCore3x.OData.csproj)' + inputs: + command: test + projects: '$(Build.SourcesDirectory)\test\E2ETest\Microsoft.Test.E2E.AspNet.OData\Build.AspNetCore3x\Microsoft.Test.E2E.AspNetCore3x.OData.csproj' + arguments: '--configuration $(BuildConfiguration) --no-build --filter FullyQualifiedName!=Microsoft.Test.E2E.AspNet.OData.QueryComposition.SelectExpandEFTests.QueryForLongSelectList -v diag' + +- task: VSTest@2 + displayName: 'Classic Unit Tests (Microsoft.AspNet.OData.Test.dll)' + inputs: + testAssemblyVer2: '**\bin\**\UnitTest\**\Microsoft.AspNet.OData.Test.dll' + +- task: DotNetCoreCLI@2 + displayName: 'Core Unit Tests (Microsoft.AspNetCore.OData.Test.csproj) ' + inputs: + command: test + projects: '$(Build.SourcesDirectory)\test\UnitTest\Microsoft.AspNetCore.OData.Test\Microsoft.AspNetCore.OData.Test.csproj' + arguments: '--configuration $(BuildConfiguration) --no-build' + +- task: VSTest@2 + displayName: 'Classic E2E Tests (Microsoft.Test.E2E.AspNet.OData.dll)' + inputs: + testAssemblyVer2: '**\bin\**\E2ETest\**\Microsoft.Test.E2E.AspNet.OData.dll' + testFiltercriteria: '(DisplayName!=Microsoft.Test.E2E.AspNet.OData.ODataPathHandler.UnicodeRouteTests_Todoü.CRUDEntitySetShouldWork)' diff --git a/samples/AspNetCore3xEndpointSample.Web/Controllers/CustomersController.cs b/samples/AspNetCore3xEndpointSample.Web/Controllers/CustomersController.cs index b6b21f526f..c84e090d70 100644 --- a/samples/AspNetCore3xEndpointSample.Web/Controllers/CustomersController.cs +++ b/samples/AspNetCore3xEndpointSample.Web/Controllers/CustomersController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/samples/AspNetCore3xEndpointSample.Web/Controllers/ODataOperationImportController.cs b/samples/AspNetCore3xEndpointSample.Web/Controllers/ODataOperationImportController.cs index 4242291372..2ba4f467c6 100644 --- a/samples/AspNetCore3xEndpointSample.Web/Controllers/ODataOperationImportController.cs +++ b/samples/AspNetCore3xEndpointSample.Web/Controllers/ODataOperationImportController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData; using Microsoft.AspNetCore.Mvc; diff --git a/samples/AspNetCore3xEndpointSample.Web/Controllers/WeatherForecastController.cs b/samples/AspNetCore3xEndpointSample.Web/Controllers/WeatherForecastController.cs index cda9f1e032..b4785780bd 100644 --- a/samples/AspNetCore3xEndpointSample.Web/Controllers/WeatherForecastController.cs +++ b/samples/AspNetCore3xEndpointSample.Web/Controllers/WeatherForecastController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/samples/AspNetCore3xEndpointSample.Web/Models/CustomerOrder.cs b/samples/AspNetCore3xEndpointSample.Web/Models/CustomerOrder.cs index 5ac809cf4f..389d1ed14f 100644 --- a/samples/AspNetCore3xEndpointSample.Web/Models/CustomerOrder.cs +++ b/samples/AspNetCore3xEndpointSample.Web/Models/CustomerOrder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; diff --git a/samples/AspNetCore3xEndpointSample.Web/Models/CustomerOrderContext.cs b/samples/AspNetCore3xEndpointSample.Web/Models/CustomerOrderContext.cs index 6c6e4fff2e..cff7a88407 100644 --- a/samples/AspNetCore3xEndpointSample.Web/Models/CustomerOrderContext.cs +++ b/samples/AspNetCore3xEndpointSample.Web/Models/CustomerOrderContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.EntityFrameworkCore; diff --git a/samples/AspNetCore3xEndpointSample.Web/Models/EdmModelBuilder.cs b/samples/AspNetCore3xEndpointSample.Web/Models/EdmModelBuilder.cs index 5335e1d89e..5fdea7dcd4 100644 --- a/samples/AspNetCore3xEndpointSample.Web/Models/EdmModelBuilder.cs +++ b/samples/AspNetCore3xEndpointSample.Web/Models/EdmModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; @@ -39,4 +43,4 @@ public static IEdmModel GetEdmModel() } } -} \ No newline at end of file +} diff --git a/samples/AspNetCore3xEndpointSample.Web/Models/WeatherForecast.cs b/samples/AspNetCore3xEndpointSample.Web/Models/WeatherForecast.cs index f0a79b337f..5d97a14fa6 100644 --- a/samples/AspNetCore3xEndpointSample.Web/Models/WeatherForecast.cs +++ b/samples/AspNetCore3xEndpointSample.Web/Models/WeatherForecast.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/samples/AspNetCore3xEndpointSample.Web/Program.cs b/samples/AspNetCore3xEndpointSample.Web/Program.cs index fe23386a20..3ac68f4c90 100644 --- a/samples/AspNetCore3xEndpointSample.Web/Program.cs +++ b/samples/AspNetCore3xEndpointSample.Web/Program.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; diff --git a/samples/AspNetCore3xEndpointSample.Web/Startup.cs b/samples/AspNetCore3xEndpointSample.Web/Startup.cs index 667d735e05..e0a5392ee0 100644 --- a/samples/AspNetCore3xEndpointSample.Web/Startup.cs +++ b/samples/AspNetCore3xEndpointSample.Web/Startup.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/samples/AspNetCore3xODataSample.Web/Controllers/CustomersController.cs b/samples/AspNetCore3xODataSample.Web/Controllers/CustomersController.cs index 6eda606d3d..e88fdcb4f6 100644 --- a/samples/AspNetCore3xODataSample.Web/Controllers/CustomersController.cs +++ b/samples/AspNetCore3xODataSample.Web/Controllers/CustomersController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/samples/AspNetCore3xODataSample.Web/Models/CustomerOrder.cs b/samples/AspNetCore3xODataSample.Web/Models/CustomerOrder.cs index ea9ba905ae..d7e3931782 100644 --- a/samples/AspNetCore3xODataSample.Web/Models/CustomerOrder.cs +++ b/samples/AspNetCore3xODataSample.Web/Models/CustomerOrder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; diff --git a/samples/AspNetCore3xODataSample.Web/Models/CustomerOrderContext.cs b/samples/AspNetCore3xODataSample.Web/Models/CustomerOrderContext.cs index 1cdb7293c9..0300cf37d4 100644 --- a/samples/AspNetCore3xODataSample.Web/Models/CustomerOrderContext.cs +++ b/samples/AspNetCore3xODataSample.Web/Models/CustomerOrderContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.EntityFrameworkCore; diff --git a/samples/AspNetCore3xODataSample.Web/Models/EdmModelBuilder.cs b/samples/AspNetCore3xODataSample.Web/Models/EdmModelBuilder.cs index 9fa9080c25..b6e144eac9 100644 --- a/samples/AspNetCore3xODataSample.Web/Models/EdmModelBuilder.cs +++ b/samples/AspNetCore3xODataSample.Web/Models/EdmModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; @@ -24,4 +28,4 @@ public static IEdmModel GetEdmModel() } } -} \ No newline at end of file +} diff --git a/samples/AspNetCore3xODataSample.Web/Program.cs b/samples/AspNetCore3xODataSample.Web/Program.cs index 8368ae5f26..7aa097645f 100644 --- a/samples/AspNetCore3xODataSample.Web/Program.cs +++ b/samples/AspNetCore3xODataSample.Web/Program.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Hosting; diff --git a/samples/AspNetCore3xODataSample.Web/Startup.cs b/samples/AspNetCore3xODataSample.Web/Startup.cs index b8051e2e6b..c35dfcd152 100644 --- a/samples/AspNetCore3xODataSample.Web/Startup.cs +++ b/samples/AspNetCore3xODataSample.Web/Startup.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using AspNetCore3xODataSample.Web.Models; using Microsoft.AspNet.OData.Extensions; diff --git a/samples/AspNetCoreODataSample.Web/Controllers/CustomersController.cs b/samples/AspNetCoreODataSample.Web/Controllers/CustomersController.cs index c30cccbaf6..8753cadb9e 100644 --- a/samples/AspNetCoreODataSample.Web/Controllers/CustomersController.cs +++ b/samples/AspNetCoreODataSample.Web/Controllers/CustomersController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/samples/AspNetCoreODataSample.Web/Controllers/MoviesController.cs b/samples/AspNetCoreODataSample.Web/Controllers/MoviesController.cs index bdf2af60d2..4449b721b9 100644 --- a/samples/AspNetCoreODataSample.Web/Controllers/MoviesController.cs +++ b/samples/AspNetCoreODataSample.Web/Controllers/MoviesController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/samples/AspNetCoreODataSample.Web/Controllers/PeopleController.cs b/samples/AspNetCoreODataSample.Web/Controllers/PeopleController.cs index cf2848eed7..58902a17ba 100644 --- a/samples/AspNetCoreODataSample.Web/Controllers/PeopleController.cs +++ b/samples/AspNetCoreODataSample.Web/Controllers/PeopleController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using AspNetCoreODataSample.Web.Models; diff --git a/samples/AspNetCoreODataSample.Web/Models/CustomerOrderModel.cs b/samples/AspNetCoreODataSample.Web/Models/CustomerOrderModel.cs index fb9f1c1d23..de17bd5ea3 100644 --- a/samples/AspNetCoreODataSample.Web/Models/CustomerOrderModel.cs +++ b/samples/AspNetCoreODataSample.Web/Models/CustomerOrderModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/samples/AspNetCoreODataSample.Web/Models/EdmModelBuilder.cs b/samples/AspNetCoreODataSample.Web/Models/EdmModelBuilder.cs index 1a9c0c091c..467413771d 100644 --- a/samples/AspNetCoreODataSample.Web/Models/EdmModelBuilder.cs +++ b/samples/AspNetCoreODataSample.Web/Models/EdmModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/samples/AspNetCoreODataSample.Web/Models/Genre.cs b/samples/AspNetCoreODataSample.Web/Models/Genre.cs index 0036c433a7..b59ab7fd0e 100644 --- a/samples/AspNetCoreODataSample.Web/Models/Genre.cs +++ b/samples/AspNetCoreODataSample.Web/Models/Genre.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace AspNetCoreODataSample.Web.Models { diff --git a/samples/AspNetCoreODataSample.Web/Models/Level.cs b/samples/AspNetCoreODataSample.Web/Models/Level.cs index 50da049367..1c3b27de78 100644 --- a/samples/AspNetCoreODataSample.Web/Models/Level.cs +++ b/samples/AspNetCoreODataSample.Web/Models/Level.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Runtime.Serialization; diff --git a/samples/AspNetCoreODataSample.Web/Models/Movie.cs b/samples/AspNetCoreODataSample.Web/Models/Movie.cs index d584a37ac8..6ce6fcf0a3 100644 --- a/samples/AspNetCoreODataSample.Web/Models/Movie.cs +++ b/samples/AspNetCoreODataSample.Web/Models/Movie.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/samples/AspNetCoreODataSample.Web/Models/MovieContext.cs b/samples/AspNetCoreODataSample.Web/Models/MovieContext.cs index f76826a0a1..5af64f6690 100644 --- a/samples/AspNetCoreODataSample.Web/Models/MovieContext.cs +++ b/samples/AspNetCoreODataSample.Web/Models/MovieContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.EntityFrameworkCore; diff --git a/samples/AspNetCoreODataSample.Web/Models/MovieStar.cs b/samples/AspNetCoreODataSample.Web/Models/MovieStar.cs index 99893f548d..de8a2b60de 100644 --- a/samples/AspNetCoreODataSample.Web/Models/MovieStar.cs +++ b/samples/AspNetCoreODataSample.Web/Models/MovieStar.cs @@ -1,4 +1,11 @@ -namespace AspNetCoreODataSample.Web.Models +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +namespace AspNetCoreODataSample.Web.Models { public class MovieStar { @@ -10,4 +17,4 @@ public class MovieStar public string LastName { get; set; } } -} \ No newline at end of file +} diff --git a/samples/AspNetCoreODataSample.Web/Models/Person.cs b/samples/AspNetCoreODataSample.Web/Models/Person.cs index fbcee7242c..9130d9c6b7 100644 --- a/samples/AspNetCoreODataSample.Web/Models/Person.cs +++ b/samples/AspNetCoreODataSample.Web/Models/Person.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; diff --git a/samples/AspNetCoreODataSample.Web/Program.cs b/samples/AspNetCoreODataSample.Web/Program.cs index 4772a7368b..f3adf83994 100644 --- a/samples/AspNetCoreODataSample.Web/Program.cs +++ b/samples/AspNetCoreODataSample.Web/Program.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNetCore; using Microsoft.AspNetCore.Hosting; diff --git a/samples/AspNetCoreODataSample.Web/Startup.cs b/samples/AspNetCoreODataSample.Web/Startup.cs index 6518f0198b..a2e41ad9d9 100644 --- a/samples/AspNetCoreODataSample.Web/Startup.cs +++ b/samples/AspNetCoreODataSample.Web/Startup.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNetCore.Builder; using Microsoft.AspNetCore.Hosting; diff --git a/samples/AspNetODataSample.Web/App_Start/WebApiConfig.cs b/samples/AspNetODataSample.Web/App_Start/WebApiConfig.cs index 7a1355dc59..99d72a5e0a 100644 --- a/samples/AspNetODataSample.Web/App_Start/WebApiConfig.cs +++ b/samples/AspNetODataSample.Web/App_Start/WebApiConfig.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using AspNetODataSample.Web.Models; diff --git a/samples/AspNetODataSample.Web/AspNetODataSample.Web.csproj b/samples/AspNetODataSample.Web/AspNetODataSample.Web.csproj index ec9a437faf..028797ecc0 100644 --- a/samples/AspNetODataSample.Web/AspNetODataSample.Web.csproj +++ b/samples/AspNetODataSample.Web/AspNetODataSample.Web.csproj @@ -88,16 +88,23 @@ True - - ..\..\sln\packages\Microsoft.OData.Core.7.9.0\lib\net45\Microsoft.OData.Core.dll + + ..\..\sln\packages\Microsoft.OData.Core.7.9.1\lib\net45\Microsoft.OData.Core.dll - - ..\..\sln\packages\Microsoft.OData.Edm.7.9.0\lib\net45\Microsoft.OData.Edm.dll + + ..\..\sln\packages\Microsoft.OData.Edm.7.9.1\lib\net45\Microsoft.OData.Edm.dll ..\..\sln\packages\Microsoft.Spatial.7.9.0\lib\net45\Microsoft.Spatial.dll + ..\..\sln\packages\Microsoft.Spatial.7.9.1\lib\net45\Microsoft.Spatial.dll True + + ..\..\sln\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + + + ..\..\sln\packages\System.Buffers.4.5.0\lib\netstandard2.0\System.Buffers.dll + ..\..\sln\packages\System.Buffers.4.5.1\lib\net461\System.Buffers.dll diff --git a/samples/AspNetODataSample.Web/Controllers/ODataOperationImportController.cs b/samples/AspNetODataSample.Web/Controllers/ODataOperationImportController.cs index 3f5c71079b..97d90bdda9 100644 --- a/samples/AspNetODataSample.Web/Controllers/ODataOperationImportController.cs +++ b/samples/AspNetODataSample.Web/Controllers/ODataOperationImportController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http; @@ -16,4 +20,4 @@ public IHttpActionResult RateByOrder(int order) return Ok($"In RateByOrder using Order = {order}"); } } -} \ No newline at end of file +} diff --git a/samples/AspNetODataSample.Web/Controllers/TodoItemsController.cs b/samples/AspNetODataSample.Web/Controllers/TodoItemsController.cs index 88848fdabb..ba4fd8a00d 100644 --- a/samples/AspNetODataSample.Web/Controllers/TodoItemsController.cs +++ b/samples/AspNetODataSample.Web/Controllers/TodoItemsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http; @@ -45,4 +49,4 @@ public IHttpActionResult Post(TodoItem item) return Created(item); } } -} \ No newline at end of file +} diff --git a/samples/AspNetODataSample.Web/Global.asax.cs b/samples/AspNetODataSample.Web/Global.asax.cs index a75bb47339..570817d199 100644 --- a/samples/AspNetODataSample.Web/Global.asax.cs +++ b/samples/AspNetODataSample.Web/Global.asax.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; diff --git a/samples/AspNetODataSample.Web/Models/DataSource.cs b/samples/AspNetODataSample.Web/Models/DataSource.cs index dda8357516..91d1e174db 100644 --- a/samples/AspNetODataSample.Web/Models/DataSource.cs +++ b/samples/AspNetODataSample.Web/Models/DataSource.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; @@ -42,4 +46,4 @@ public static IList GetTodoItems() return _items; } } -} \ No newline at end of file +} diff --git a/samples/AspNetODataSample.Web/Models/EdmModelBuilder.cs b/samples/AspNetODataSample.Web/Models/EdmModelBuilder.cs index 26c65f3553..bd0553bc43 100644 --- a/samples/AspNetODataSample.Web/Models/EdmModelBuilder.cs +++ b/samples/AspNetODataSample.Web/Models/EdmModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; @@ -26,4 +30,4 @@ public static IEdmModel GetEdmModel() return _model; } } -} \ No newline at end of file +} diff --git a/samples/AspNetODataSample.Web/Models/TodoItem.cs b/samples/AspNetODataSample.Web/Models/TodoItem.cs index a694c28eaa..ecb91e9c44 100644 --- a/samples/AspNetODataSample.Web/Models/TodoItem.cs +++ b/samples/AspNetODataSample.Web/Models/TodoItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace AspNetODataSample.Web.Models { @@ -9,4 +13,4 @@ public class TodoItem public string Name { get; set; } public bool IsComplete { get; set; } } -} \ No newline at end of file +} diff --git a/samples/AspNetODataSample.Web/Models/TodoItemContext.cs b/samples/AspNetODataSample.Web/Models/TodoItemContext.cs index 98831347e1..e658caa153 100644 --- a/samples/AspNetODataSample.Web/Models/TodoItemContext.cs +++ b/samples/AspNetODataSample.Web/Models/TodoItemContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Data.Entity; @@ -9,4 +13,4 @@ public class TodoItemContext : DbContext { public DbSet TodoItems { get; set; } } -} \ No newline at end of file +} diff --git a/samples/AspNetODataSample.Web/Properties/AssemblyInfo.cs b/samples/AspNetODataSample.Web/Properties/AssemblyInfo.cs index 6c6e473732..67f61cde26 100644 --- a/samples/AspNetODataSample.Web/Properties/AssemblyInfo.cs +++ b/samples/AspNetODataSample.Web/Properties/AssemblyInfo.cs @@ -1,4 +1,11 @@ -using System.Reflection; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; @@ -10,7 +17,7 @@ [assembly: AssemblyConfiguration("")] [assembly: AssemblyCompany("")] [assembly: AssemblyProduct("AspNetODataSample.Web")] -[assembly: AssemblyCopyright("Copyright © 2018")] +[assembly: AssemblyCopyright("Copyright © 2018")] [assembly: AssemblyTrademark("")] [assembly: AssemblyCulture("")] diff --git a/samples/AspNetODataSample.Web/Web.config b/samples/AspNetODataSample.Web/Web.config index e7cb3db212..2a98e0bd9a 100644 --- a/samples/AspNetODataSample.Web/Web.config +++ b/samples/AspNetODataSample.Web/Web.config @@ -4,85 +4,89 @@ http://go.microsoft.com/fwlink/?LinkId=301879 --> - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/samples/AspNetODataSample.Web/packages.config b/samples/AspNetODataSample.Web/packages.config index eb858a6251..0e99202ef2 100644 --- a/samples/AspNetODataSample.Web/packages.config +++ b/samples/AspNetODataSample.Web/packages.config @@ -15,9 +15,9 @@ - - - + + + diff --git a/src/CommonAssemblyInfo.cs b/src/CommonAssemblyInfo.cs index 522a341f32..d9467db637 100644 --- a/src/CommonAssemblyInfo.cs +++ b/src/CommonAssemblyInfo.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/src/GlobalSuppressions.cs b/src/GlobalSuppressions.cs index ccb18befdd..1558193e78 100644 --- a/src/GlobalSuppressions.cs +++ b/src/GlobalSuppressions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Batch/ODataBatchContent.cs b/src/Microsoft.AspNet.OData.Shared/Batch/ODataBatchContent.cs index ee8abb0e8f..d3238655e0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Batch/ODataBatchContent.cs +++ b/src/Microsoft.AspNet.OData.Shared/Batch/ODataBatchContent.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -60,4 +64,4 @@ private async Task WriteToResponseMessageAsync(IODataResponseMessage responseMes await writer.WriteEndBatchAsync(); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Batch/ODataBatchHandler.cs b/src/Microsoft.AspNet.OData.Shared/Batch/ODataBatchHandler.cs index af04043da0..fd84167352 100644 --- a/src/Microsoft.AspNet.OData.Shared/Batch/ODataBatchHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Batch/ODataBatchHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Interfaces; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ActionConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ActionConfiguration.cs index 4d117676e8..fbe1975ee1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ActionConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ActionConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ActionOnDeleteAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ActionOnDeleteAttribute.cs index 7de1e0b302..f27cb02028 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ActionOnDeleteAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ActionOnDeleteAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/AutoExpandAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Builder/AutoExpandAttribute.cs index dfa4159679..ccc4b34356 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/AutoExpandAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/AutoExpandAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/BindableOperationFinder.cs b/src/Microsoft.AspNet.OData.Shared/Builder/BindableOperationFinder.cs index bc1bcab5a4..85cac5803e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/BindableOperationFinder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/BindableOperationFinder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/BindingParameterConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/BindingParameterConfiguration.cs index e14b343518..9f75f1ba52 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/BindingParameterConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/BindingParameterConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/BindingPathConfigurationOfTStructuralType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/BindingPathConfigurationOfTStructuralType.cs index ebd9a9f733..ab39b7ef12 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/BindingPathConfigurationOfTStructuralType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/BindingPathConfigurationOfTStructuralType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/BindingPathHelper.cs b/src/Microsoft.AspNet.OData.Shared/Builder/BindingPathHelper.cs index 3fe7eb64a6..60da3fc64d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/BindingPathHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/BindingPathHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesNavigationType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesNavigationType.cs index 7aa60add38..a0205ebba3 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesNavigationType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesNavigationType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder { @@ -23,4 +27,4 @@ internal enum CapabilitiesNavigationType /// None } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesVocabularyConstants.cs b/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesVocabularyConstants.cs index 0a4f19ad9f..e1b0c55111 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesVocabularyConstants.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesVocabularyConstants.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesVocabularyExtensionMethods.cs b/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesVocabularyExtensionMethods.cs index df75bb3867..36e5c6a20d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesVocabularyExtensionMethods.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/CapabilitiesVocabularyExtensionMethods.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/CollectionPropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/CollectionPropertyConfiguration.cs index 18eb976e8e..06d40326eb 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/CollectionPropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/CollectionPropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/CollectionTypeConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/CollectionTypeConfiguration.cs index 8c86672ec2..67c92ddbdc 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/CollectionTypeConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/CollectionTypeConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Globalization; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ComplexPropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ComplexPropertyConfiguration.cs index e2034f0dd5..39f5439d86 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ComplexPropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ComplexPropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; @@ -74,4 +78,4 @@ public ComplexPropertyConfiguration HasDerivedTypeConstraint() return this; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ComplexTypeConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ComplexTypeConfiguration.cs index ead59e4b9e..0fde2a585c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ComplexTypeConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ComplexTypeConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ComplexTypeConfigurationOfTComplexType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ComplexTypeConfigurationOfTComplexType.cs index 88e3d39b24..200ac639ad 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ComplexTypeConfigurationOfTComplexType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ComplexTypeConfigurationOfTComplexType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ContainedAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ContainedAttribute.cs index 1a12515f80..a237c9fa72 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ContainedAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ContainedAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ContainmentPathBuilder.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ContainmentPathBuilder.cs index 0d76f38b92..07862bf96c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ContainmentPathBuilder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ContainmentPathBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AbstractEntityTypeDiscoveryConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AbstractEntityTypeDiscoveryConvention.cs index 809520dff3..559388f47f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AbstractEntityTypeDiscoveryConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AbstractEntityTypeDiscoveryConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder.Conventions { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AbstractTypeDiscoveryConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AbstractTypeDiscoveryConvention.cs index 40c984aeb5..ff97a93db4 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AbstractTypeDiscoveryConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AbstractTypeDiscoveryConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder.Conventions { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ActionLinkGenerationConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ActionLinkGenerationConvention.cs index 554b1837fc..0e83286a65 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ActionLinkGenerationConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ActionLinkGenerationConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AssociationSetDiscoveryConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AssociationSetDiscoveryConvention.cs index f3732a22a6..80fa0ac84a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AssociationSetDiscoveryConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/AssociationSetDiscoveryConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ActionOnDeleteAttributeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ActionOnDeleteAttributeConvention.cs index 3d556fcbdc..ef252528c3 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ActionOnDeleteAttributeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ActionOnDeleteAttributeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeConvention.cs index fba65b6eab..21646d1278 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeEdmPropertyConvention.cs index ef3348c992..f49ff696fd 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeEdmTypeConvention.cs index f4ac7acea8..6cf65266ac 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AttributeEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AutoExpandAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AutoExpandAttributeEdmPropertyConvention.cs index a5ef2e7263..b93e991f61 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AutoExpandAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AutoExpandAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AutoExpandAttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AutoExpandAttributeEdmTypeConvention.cs index ab4ec21c76..21a6c9042a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AutoExpandAttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/AutoExpandAttributeEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ColumnAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ColumnAttributeEdmPropertyConvention.cs index 799be114f7..28a1dd6705 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ColumnAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ColumnAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations.Schema; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ComplexTypeAttributeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ComplexTypeAttributeConvention.cs index 7ec7f93fe3..75013de5f2 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ComplexTypeAttributeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ComplexTypeAttributeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations.Schema; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ConcurrencyCheckAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ConcurrencyCheckAttributeEdmPropertyConvention.cs index cbea8b615d..f1a08547e1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ConcurrencyCheckAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ConcurrencyCheckAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/CountAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/CountAttributeEdmPropertyConvention.cs index 8828782c8b..641d5aa649 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/CountAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/CountAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/CountAttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/CountAttributeEdmTypeConvention.cs index 27c4762c8a..dba23d1945 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/CountAttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/CountAttributeEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataContractAttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataContractAttributeEdmTypeConvention.cs index 642581dded..690d1b25f6 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataContractAttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataContractAttributeEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataContractAttributeEnumTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataContractAttributeEnumTypeConvention.cs index 1cc236c1a2..a614f16a44 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataContractAttributeEnumTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataContractAttributeEnumTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataMemberAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataMemberAttributeEdmPropertyConvention.cs index 2269869685..3487b75f43 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataMemberAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DataMemberAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DefaultValueAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DefaultValueAttributeEdmPropertyConvention.cs index 17c17378a7..7ff0c6b15c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DefaultValueAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DefaultValueAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DerivedTypeConstraintAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DerivedTypeConstraintAttributeEdmPropertyConvention.cs index bbdcec7a4e..f93ac0b052 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DerivedTypeConstraintAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/DerivedTypeConstraintAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ExpandAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ExpandAttributeEdmPropertyConvention.cs index 427fdb04a9..3e46aceecd 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ExpandAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ExpandAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ExpandAttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ExpandAttributeEdmTypeConvention.cs index 29d4816340..7852714d0e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ExpandAttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ExpandAttributeEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/FilterAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/FilterAttributeEdmPropertyConvention.cs index ad67cdc41f..9221e9703a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/FilterAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/FilterAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/FilterAttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/FilterAttributeEdmTypeConvention.cs index 54a28c2fee..62d4921d52 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/FilterAttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/FilterAttributeEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ForeignKeyAttributeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ForeignKeyAttributeConvention.cs index 7ded2e39f4..8b0384ea8f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ForeignKeyAttributeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/ForeignKeyAttributeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/IgnoreDataMemberAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/IgnoreDataMemberAttributeEdmPropertyConvention.cs index 21e9a6db85..5b75c5caf1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/IgnoreDataMemberAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/IgnoreDataMemberAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/KeyAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/KeyAttributeEdmPropertyConvention.cs index 745c1e6f7d..84bd20023e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/KeyAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/KeyAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/MaxLengthAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/MaxLengthAttributeEdmPropertyConvention.cs index d897a1624b..d230e4a42d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/MaxLengthAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/MaxLengthAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/MediaTypeAttributeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/MediaTypeAttributeConvention.cs index 31027691bd..c16a16cf80 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/MediaTypeAttributeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/MediaTypeAttributeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NonFilterableAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NonFilterableAttributeEdmPropertyConvention.cs index 5a891bca42..638aa3a5cb 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NonFilterableAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NonFilterableAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotCountableAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotCountableAttributeEdmPropertyConvention.cs index 5c6d6816e0..18b66d6345 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotCountableAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotCountableAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; @@ -30,4 +34,4 @@ public override void Apply(PropertyConfiguration edmProperty, } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotExpandableAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotExpandableAttributeEdmPropertyConvention.cs index 920574c34f..7f070bfae3 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotExpandableAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotExpandableAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotFilterableAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotFilterableAttributeEdmPropertyConvention.cs index cdf5d32d91..2c1ef42914 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotFilterableAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotFilterableAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotMappedAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotMappedAttributeEdmPropertyConvention.cs index 2b2b189107..46198d2ec0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotMappedAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotMappedAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotNavigableAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotNavigableAttributeEdmPropertyConvention.cs index e972a1d967..e98bda77f7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotNavigableAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotNavigableAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotSortableAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotSortableAttributeEdmPropertyConvention.cs index e4c03230a8..bbd6be210f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotSortableAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/NotSortableAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/OrderByAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/OrderByAttributeEdmPropertyConvention.cs index a50e02da01..0bce099695 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/OrderByAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/OrderByAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/OrderByAttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/OrderByAttributeEdmTypeConvention.cs index f508456c41..2d447635f8 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/OrderByAttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/OrderByAttributeEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmPropertyConvention.cs index 6952ee8e43..b8c4cb7538 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmTypeConvention.cs index d6e7523aa8..61f174db57 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/PageAttributeEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/RequiredAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/RequiredAttributeEdmPropertyConvention.cs index dfc86ccefb..6637ccdee1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/RequiredAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/RequiredAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/SelectAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/SelectAttributeEdmPropertyConvention.cs index 6115b08af7..33279c206b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/SelectAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/SelectAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/SelectAttributeEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/SelectAttributeEdmTypeConvention.cs index 7a4a7427f4..1eb446275f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/SelectAttributeEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/SelectAttributeEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/TimestampAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/TimestampAttributeEdmPropertyConvention.cs index 044e64c10b..1d07b95c2e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/TimestampAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/TimestampAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/UnsortableAttributeEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/UnsortableAttributeEdmPropertyConvention.cs index e077686aab..7190b7276c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/UnsortableAttributeEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/Attributes/UnsortableAttributeEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ConventionsHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ConventionsHelpers.cs index 21a4194424..a67090b7ab 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ConventionsHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ConventionsHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/EntityKeyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/EntityKeyConvention.cs index 14703f3010..8d28e64676 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/EntityKeyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/EntityKeyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/EntityTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/EntityTypeConvention.cs index 0188c81e3b..a00db3b6ab 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/EntityTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/EntityTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder.Conventions { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ForeignKeyDiscoveryConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ForeignKeyDiscoveryConvention.cs index 3eabb7bd73..a6d9ced2fd 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ForeignKeyDiscoveryConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/ForeignKeyDiscoveryConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/FunctionLinkGenerationConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/FunctionLinkGenerationConvention.cs index e16e04376f..13faabccad 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/FunctionLinkGenerationConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/FunctionLinkGenerationConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IConvention.cs index a4788afb54..b34e0cd979 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmPropertyConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmPropertyConvention.cs index 8b8c69b526..f5602d9f83 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmPropertyConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmPropertyConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder.Conventions { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmPropertyConventionOfTPropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmPropertyConventionOfTPropertyConfiguration.cs index 7072c3bf97..ca6dadece7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmPropertyConventionOfTPropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmPropertyConventionOfTPropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder.Conventions { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmTypeConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmTypeConvention.cs index c5ff8cf56a..ffa0e51841 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmTypeConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IEdmTypeConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder.Conventions { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/INavigationSourceConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/INavigationSourceConvention.cs index b94728f57f..027c04b4a0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/INavigationSourceConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/INavigationSourceConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder.Conventions { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IOperationConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IOperationConvention.cs index 4a7aa0ad7e..8cb7fcc498 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IOperationConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/IOperationConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder.Conventions { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/NavigationLinksGenerationConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/NavigationLinksGenerationConvention.cs index ea6a56d03e..d1d34ab8b8 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/NavigationLinksGenerationConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/NavigationLinksGenerationConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/SelfLinksGenerationConvention.cs b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/SelfLinksGenerationConvention.cs index 2ba44eea76..4bb62b74cb 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/SelfLinksGenerationConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/Conventions/SelfLinksGenerationConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/DecimalPropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/DecimalPropertyConfiguration.cs index e271844535..23bc7a2647 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/DecimalPropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/DecimalPropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; @@ -26,4 +30,4 @@ public DecimalPropertyConfiguration(PropertyInfo property, StructuralTypeConfigu /// public int? Scale { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/DerivedTypeConstraintAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Builder/DerivedTypeConstraintAttribute.cs index f24a5ebb6b..62da93cb78 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/DerivedTypeConstraintAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/DerivedTypeConstraintAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/DerivedTypeConstraintConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/DerivedTypeConstraintConfiguration.cs index ae0a6bd410..a892e1c2e0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/DerivedTypeConstraintConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/DerivedTypeConstraintConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/DynamicPropertyDictionaryAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/Builder/DynamicPropertyDictionaryAnnotation.cs index 5daafd88f8..cc1e566606 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/DynamicPropertyDictionaryAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/DynamicPropertyDictionaryAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EdmModelHelperMethods.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EdmModelHelperMethods.cs index a161d93110..8337a6faa2 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EdmModelHelperMethods.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EdmModelHelperMethods.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeBuilder.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeBuilder.cs index af528225fd..c07c04b857 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeBuilder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -18,7 +22,7 @@ namespace Microsoft.AspNet.OData.Builder /// /// builds 's from 's. /// - [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Class coupling acceptable")] + [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Class coupling acceptable")] internal class EdmTypeBuilder { private readonly List _configurations; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeConfigurationExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeConfigurationExtensions.cs index ab05bf4d82..80607330e6 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeConfigurationExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeConfigurationExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeMap.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeMap.cs index 92b3cf705a..e25af27610 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeMap.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EdmTypeMap.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EntityCollectionConfigurationOfTEntityType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EntityCollectionConfigurationOfTEntityType.cs index 0759c821ff..191bdf3e31 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EntityCollectionConfigurationOfTEntityType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EntityCollectionConfigurationOfTEntityType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.Contracts; @@ -44,4 +48,4 @@ public FunctionConfiguration Function(string name) return configuration; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EntitySetConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EntitySetConfiguration.cs index e79faa5c35..11c3e49c69 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EntitySetConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EntitySetConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EntitySetConfigurationOfTEntityType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EntitySetConfigurationOfTEntityType.cs index a2c91ee1e6..926093960a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EntitySetConfigurationOfTEntityType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EntitySetConfigurationOfTEntityType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EntityTypeConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EntityTypeConfiguration.cs index 4caef94c0d..0f34918c2b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EntityTypeConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EntityTypeConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EntityTypeConfigurationOfTEntityType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EntityTypeConfigurationOfTEntityType.cs index e6cd007f9c..fcf3492c55 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EntityTypeConfigurationOfTEntityType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EntityTypeConfigurationOfTEntityType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EnumMemberConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EnumMemberConfiguration.cs index c9509c0098..6d8e10b870 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EnumMemberConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EnumMemberConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; @@ -75,4 +79,4 @@ public string Name /// The default value is true public bool AddedExplicitly { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EnumPropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EnumPropertyConfiguration.cs index 0ed2eba4ff..e4cb9fd992 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EnumPropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EnumPropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EnumTypeConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EnumTypeConfiguration.cs index 48279da3d9..f31ff1661a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EnumTypeConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EnumTypeConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/EnumTypeConfigurationOfTEnumType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/EnumTypeConfigurationOfTEnumType.cs index 881b392b66..14520d30be 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/EnumTypeConfigurationOfTEnumType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/EnumTypeConfigurationOfTEnumType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -93,4 +97,4 @@ public EnumMemberConfiguration Member(TEnumType enumMember) return _configuration.AddMember((Enum)(object)enumMember); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/FunctionConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/FunctionConfiguration.cs index 382895585c..ca6489e696 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/FunctionConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/FunctionConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/IEdmTypeConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/IEdmTypeConfiguration.cs index 7f76ce1bec..ec53f655e9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/IEdmTypeConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/IEdmTypeConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/IODataInstanceAnnotationContainer.cs b/src/Microsoft.AspNet.OData.Shared/Builder/IODataInstanceAnnotationContainer.cs index b6118ac630..619e1023b5 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/IODataInstanceAnnotationContainer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/IODataInstanceAnnotationContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/InstanceAnnotationContainerAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/Builder/InstanceAnnotationContainerAnnotation.cs index 87638c87e5..4ec2cd4199 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/InstanceAnnotationContainerAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/InstanceAnnotationContainerAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/LengthPropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/LengthPropertyConfiguration.cs index 2e646468a8..668f9778da 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/LengthPropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/LengthPropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; @@ -26,4 +30,4 @@ public LengthPropertyConfiguration(PropertyInfo property, StructuralTypeConfigur /// public int? MaxLength { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/LinkGenerationHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Builder/LinkGenerationHelpers.cs index 07deb35170..c4d4b109e9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/LinkGenerationHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/LinkGenerationHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/LowerCamelCaser.cs b/src/Microsoft.AspNet.OData.Shared/Builder/LowerCamelCaser.cs index 9bd1b4ed96..cd34c71c72 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/LowerCamelCaser.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/LowerCamelCaser.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/MediaTypeAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Builder/MediaTypeAttribute.cs index fb91b33f31..bf54a33b8b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/MediaTypeAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/MediaTypeAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NameResolverOptions.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NameResolverOptions.cs index 41305f8d82..16cfec6128 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NameResolverOptions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NameResolverOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationLinkBuilder.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationLinkBuilder.cs index 1b125e48e1..e53409cf1d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationLinkBuilder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationLinkBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyBindingConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyBindingConfiguration.cs index 0124591ea7..467ddc2291 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyBindingConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyBindingConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyBindingOption.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyBindingOption.cs index 3962997cd2..5aec0bfdea 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyBindingOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyBindingOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyConfiguration.cs index 415cc6f8ea..60173b5d27 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyExtensions.cs index 2c26940630..3595351699 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationPropertyExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceAndAnnotations.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceAndAnnotations.cs index 56873ba6bf..caec384501 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceAndAnnotations.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceAndAnnotations.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceConfiguration.cs index 8dc530a2d2..5cdfbcc39d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceConfigurationOfTEntityType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceConfigurationOfTEntityType.cs index 98cc80bc09..41fb480b8f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceConfigurationOfTEntityType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceConfigurationOfTEntityType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceLinkBuilderAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceLinkBuilderAnnotation.cs index b2f4ed9319..f65834550b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceLinkBuilderAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceLinkBuilderAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceUrlAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceUrlAnnotation.cs index 14e9190096..5631d3a3cc 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceUrlAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NavigationSourceUrlAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NonBindingParameterConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NonBindingParameterConfiguration.cs index 30a315985e..d84be338e0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NonBindingParameterConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NonBindingParameterConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/NullableEnumTypeConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/NullableEnumTypeConfiguration.cs index 74c0285163..b86b5a3efa 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/NullableEnumTypeConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/NullableEnumTypeConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ODataConventionModelBuilder.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ODataConventionModelBuilder.cs index 2d8d2a0d65..ff65fa77d1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ODataConventionModelBuilder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ODataConventionModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ODataConventionModelBuilderExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ODataConventionModelBuilderExtensions.cs index 154cd790ce..49cfc39c33 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ODataConventionModelBuilderExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ODataConventionModelBuilderExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ODataInstanceAnnotationContainer.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ODataInstanceAnnotationContainer.cs index 7c74c8057e..7b57e51dab 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ODataInstanceAnnotationContainer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ODataInstanceAnnotationContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ODataModelBuilder.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ODataModelBuilder.cs index 7a8244d481..fe30942e0d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ODataModelBuilder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ODataModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/OperationConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/OperationConfiguration.cs index 59e7f564c7..10cd67f2e2 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/OperationConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/OperationConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/OperationKind.cs b/src/Microsoft.AspNet.OData.Shared/Builder/OperationKind.cs index 89ff963425..0f9f597ada 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/OperationKind.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/OperationKind.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/OperationLinkBuilder.cs b/src/Microsoft.AspNet.OData.Shared/Builder/OperationLinkBuilder.cs index 9f72f40c12..5702ea306e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/OperationLinkBuilder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/OperationLinkBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/OperationTitleAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/Builder/OperationTitleAnnotation.cs index c2638dbc17..b87082534f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/OperationTitleAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/OperationTitleAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder { diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ParameterConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ParameterConfiguration.cs index 0a37702edd..9cdd4828cf 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ParameterConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ParameterConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/PrecisionPropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/PrecisionPropertyConfiguration.cs index 0a68dc143f..d6981a02da 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/PrecisionPropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/PrecisionPropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/PrimitivePropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/PrimitivePropertyConfiguration.cs index ae3562f249..71d16dc2bd 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/PrimitivePropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/PrimitivePropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/PrimitivePropertyConfigurationExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Builder/PrimitivePropertyConfigurationExtensions.cs index 300a3dba9d..ca10ece232 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/PrimitivePropertyConfigurationExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/PrimitivePropertyConfigurationExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/PrimitiveTypeConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/PrimitiveTypeConfiguration.cs index 7d6124e8c0..37f7f0258b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/PrimitiveTypeConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/PrimitiveTypeConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/PropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/PropertyConfiguration.cs index caf9667fb0..d266cfd6f3 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/PropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/PropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/PropertyKind.cs b/src/Microsoft.AspNet.OData.Shared/Builder/PropertyKind.cs index 5fe6aeaad7..fe8455c47d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/PropertyKind.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/PropertyKind.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Builder { @@ -44,4 +48,3 @@ public enum PropertyKind InstanceAnnotations = 6 } } - diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/PropertyPairSelectorVisitor.cs b/src/Microsoft.AspNet.OData.Shared/Builder/PropertyPairSelectorVisitor.cs index ae1d2520db..b69008487f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/PropertyPairSelectorVisitor.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/PropertyPairSelectorVisitor.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/PropertySelectorVisitor.cs b/src/Microsoft.AspNet.OData.Shared/Builder/PropertySelectorVisitor.cs index 25896a8ab7..b1f4f9f187 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/PropertySelectorVisitor.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/PropertySelectorVisitor.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/QueryConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/QueryConfiguration.cs index cd25f01f6e..9892c26d47 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/QueryConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/QueryConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Query; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/ReturnedEntitySetAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/Builder/ReturnedEntitySetAnnotation.cs index 1d715b7b62..1dbab004e7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/ReturnedEntitySetAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/ReturnedEntitySetAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/SelfLinkBuilder.cs b/src/Microsoft.AspNet.OData.Shared/Builder/SelfLinkBuilder.cs index b5311e5e5e..13ff4a0c42 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/SelfLinkBuilder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/SelfLinkBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/SingletonAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Builder/SingletonAttribute.cs index 2b741d8931..10a47228ae 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/SingletonAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/SingletonAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/SingletonConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/SingletonConfiguration.cs index 77f82ed69a..1021b97532 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/SingletonConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/SingletonConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/SingletonConfigurationOfTEntityType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/SingletonConfigurationOfTEntityType.cs index 990e8a63e7..2105e83a76 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/SingletonConfigurationOfTEntityType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/SingletonConfigurationOfTEntityType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/StructuralPropertyConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/StructuralPropertyConfiguration.cs index f31d7a13b9..245c29cbd1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/StructuralPropertyConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/StructuralPropertyConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; using Microsoft.AspNet.OData.Formatter; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/StructuralTypeConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Builder/StructuralTypeConfiguration.cs index e8bb0609a8..92ae38c776 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/StructuralTypeConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/StructuralTypeConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Builder/StructuralTypeConfigurationOfTStructuralType.cs b/src/Microsoft.AspNet.OData.Shared/Builder/StructuralTypeConfigurationOfTStructuralType.cs index e56ecf369d..85004b50e8 100644 --- a/src/Microsoft.AspNet.OData.Shared/Builder/StructuralTypeConfigurationOfTStructuralType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Builder/StructuralTypeConfigurationOfTStructuralType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/src/Microsoft.AspNet.OData.Shared/ClrEnumMemberAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/ClrEnumMemberAnnotation.cs index c5d7454463..79fa25168b 100644 --- a/src/Microsoft.AspNet.OData.Shared/ClrEnumMemberAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/ClrEnumMemberAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/ClrPropertyInfoAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/ClrPropertyInfoAnnotation.cs index 51dfc22ae7..d3440898da 100644 --- a/src/Microsoft.AspNet.OData.Shared/ClrPropertyInfoAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/ClrPropertyInfoAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/ClrTypeAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/ClrTypeAnnotation.cs index f41bd4b1a7..3ce6a0050c 100644 --- a/src/Microsoft.AspNet.OData.Shared/ClrTypeAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/ClrTypeAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Common/CollectionExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Common/CollectionExtensions.cs index b81e25ee92..72b17ab4f4 100644 --- a/src/Microsoft.AspNet.OData.Shared/Common/CollectionExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Common/CollectionExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Common/CommonWebApiResources.Designer.cs b/src/Microsoft.AspNet.OData.Shared/Common/CommonWebApiResources.Designer.cs index c55047b47f..fb9e223fff 100644 --- a/src/Microsoft.AspNet.OData.Shared/Common/CommonWebApiResources.Designer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Common/CommonWebApiResources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 diff --git a/src/Microsoft.AspNet.OData.Shared/Common/Error.cs b/src/Microsoft.AspNet.OData.Shared/Common/Error.cs index 004c0178ed..8d6e2f6aa1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Common/Error.cs +++ b/src/Microsoft.AspNet.OData.Shared/Common/Error.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -99,6 +103,7 @@ internal static ArgumentNullException PropertyNull() /// Creates an with a default message. /// /// The logged . + [SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly")] internal static ArgumentException PropertyNullOrWhiteSpace() { return new ArgumentException(CommonWebApiResources.PropertyNullOrWhiteSpace, "value"); diff --git a/src/Microsoft.AspNet.OData.Shared/Common/ListWrapperCollection.cs b/src/Microsoft.AspNet.OData.Shared/Common/ListWrapperCollection.cs index 16fba86adf..144f22c55a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Common/ListWrapperCollection.cs +++ b/src/Microsoft.AspNet.OData.Shared/Common/ListWrapperCollection.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.AspNet.OData.Shared/Common/PropertyHelper.cs b/src/Microsoft.AspNet.OData.Shared/Common/PropertyHelper.cs index 5dd6b41ac1..3e8d784a36 100644 --- a/src/Microsoft.AspNet.OData.Shared/Common/PropertyHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Common/PropertyHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Concurrent; diff --git a/src/Microsoft.AspNet.OData.Shared/Common/SRResources.Designer.cs b/src/Microsoft.AspNet.OData.Shared/Common/SRResources.Designer.cs index 3c53dad32a..44270bb897 100644 --- a/src/Microsoft.AspNet.OData.Shared/Common/SRResources.Designer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Common/SRResources.Designer.cs @@ -1,4 +1,4 @@ -//------------------------------------------------------------------------------ +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.42000 @@ -498,6 +498,17 @@ internal static string CantFindEdmType } } + /// + /// Looks up a localized string similar to Cannot use Changed Object of type '{0}' on an entity of type '{1}'.. + /// + internal static string ChangedObjectTypeMismatch + { + get + { + return ResourceManager.GetString("ChangedObjectTypeMismatch", resourceCulture); + } + } + /// /// Looks up a localized string similar to The given model does not contain the type '{0}'.. /// @@ -564,6 +575,17 @@ internal static string CollectionShouldHaveClearMethod } } + /// + /// Looks up a localized string similar to ContentID. + /// + internal static string ContentID + { + get + { + return ResourceManager.GetString("ContentID", resourceCulture); + } + } + /// /// Looks up a localized string similar to Type {0} already added as derived type constraint. /// @@ -597,6 +619,17 @@ internal static string CreateODataValueNotSupported } } + /// + /// Looks up a localized string similar to the error DataModificationException + /// + internal static string DataModificationException + { + get + { + return ResourceManager.GetString("DataModificationException", resourceCulture); + } + } + /// /// Looks up a localized string similar to The actual entity type '{0}' is not assignable to the expected type '{1}'.. /// @@ -608,6 +641,17 @@ internal static string DeltaEntityTypeNotAssignable } } + /// + /// Looks up a localized string similar to The actual error DeltaLinkNotSupported + /// + internal static string DeltaLinkNotSupported + { + get + { + return ResourceManager.GetString("DeltaLinkNotSupported", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot find nested resource name '{0}' in parent resource type '{1}'. /// @@ -2721,6 +2765,28 @@ internal static string RequestUriTooShortForODataPath } } + /// + /// Looks up a localized string similar to Cannot find the resource type '{0}' in the model.. + /// + internal static string ResourcesShouldbePresent + { + get + { + return ResourceManager.GetString("ResourcesShouldbePresent", resourceCulture); + } + } + + /// + /// Looks up a localized string similar to Cannot find the resource wrapper type '{0}' in the model.. + /// + internal static string ResourceSetWrapperSupported + { + get + { + return ResourceManager.GetString("ResourceSetWrapperSupported", resourceCulture); + } + } + /// /// Looks up a localized string similar to Cannot find the resource type '{0}' in the model.. /// diff --git a/src/Microsoft.AspNet.OData.Shared/Common/SRResources.resx b/src/Microsoft.AspNet.OData.Shared/Common/SRResources.resx index cfc417253e..270aa879ab 100644 --- a/src/Microsoft.AspNet.OData.Shared/Common/SRResources.resx +++ b/src/Microsoft.AspNet.OData.Shared/Common/SRResources.resx @@ -985,4 +985,22 @@ InstanceAnnotation Property name cannot be null or empty. + + ResourceSetWrapper should have ResourceWrappers in it + + + Can only add ResourceWrapper to ResourceSetWrapper + + + Cannot use Changed Object of type '{0}' on an entity of type '{1}'. + + + Core.DataModificationException + + + Core.ContentID + + + DeltaLinks are not supported + \ No newline at end of file diff --git a/src/Microsoft.AspNet.OData.Shared/Common/TaskHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Common/TaskHelpers.cs index c2b34cdcc1..29dcc2e14f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Common/TaskHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Common/TaskHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.OData.Shared/Common/TaskHelpersExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Common/TaskHelpersExtensions.cs index 544248a510..be032cba9b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Common/TaskHelpersExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Common/TaskHelpersExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.OData.Shared/CompatibilityOptions.cs b/src/Microsoft.AspNet.OData.Shared/CompatibilityOptions.cs index d0044de0d6..75c79df7db 100644 --- a/src/Microsoft.AspNet.OData.Shared/CompatibilityOptions.cs +++ b/src/Microsoft.AspNet.OData.Shared/CompatibilityOptions.cs @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + using System; namespace Microsoft.AspNet.OData diff --git a/src/Microsoft.AspNet.OData.Shared/CompiledPropertyAccessor.cs b/src/Microsoft.AspNet.OData.Shared/CompiledPropertyAccessor.cs index 4fb8630e50..c805035ec2 100644 --- a/src/Microsoft.AspNet.OData.Shared/CompiledPropertyAccessor.cs +++ b/src/Microsoft.AspNet.OData.Shared/CompiledPropertyAccessor.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq.Expressions; diff --git a/src/Microsoft.AspNet.OData.Shared/ConcurrencyPropertiesAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/ConcurrencyPropertiesAnnotation.cs index c41e85c977..2cc18feaa1 100644 --- a/src/Microsoft.AspNet.OData.Shared/ConcurrencyPropertiesAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/ConcurrencyPropertiesAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Concurrent; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/ContentIdHelpers.cs b/src/Microsoft.AspNet.OData.Shared/ContentIdHelpers.cs index 1ce4054680..d1f98e77ae 100644 --- a/src/Microsoft.AspNet.OData.Shared/ContentIdHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/ContentIdHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -83,4 +87,4 @@ private static bool IsContentIdCharacter(char c) } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/CustomAggregateMethodAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/CustomAggregateMethodAnnotation.cs index e510840e3e..7f4a20b735 100644 --- a/src/Microsoft.AspNet.OData.Shared/CustomAggregateMethodAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/CustomAggregateMethodAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/DataModificationExceptionType.cs b/src/Microsoft.AspNet.OData.Shared/DataModificationExceptionType.cs new file mode 100644 index 0000000000..6401a9565b --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/DataModificationExceptionType.cs @@ -0,0 +1,115 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using Microsoft.AspNet.OData.Builder; + +namespace Org.OData.Core.V1 +{ + /// + /// Represents a Message Type + /// + public class MessageType + { + /// + /// Code of message + /// + public string Code { get; set; } + + /// + /// Actual message + /// + public string Message { get; set; } + + /// + /// Severity of message + /// + public string Severity { get; set; } + + /// + /// Target of message + /// + public string Target { get; set; } + + /// + /// Details of message + /// + public string Details { get; set; } + } + + /// + /// Represents an Exception Type + /// + public abstract class ExceptionType + { + /// + /// Represents a MessageType + /// + public MessageType MessageType { get; set; } + } + + /// + /// Represents an Exception for Data modification Operation. + /// + public class DataModificationExceptionType : ExceptionType + { + /// + /// Initializes a new instance of the class. + /// + public DataModificationExceptionType(DataModificationOperationKind failedOperation) + { + this.FailedOperation = failedOperation; + } + + /// + /// Represents king of type of operation + /// + public DataModificationOperationKind FailedOperation { get; } + + /// + /// Represents response code + /// + public Int16 ResponseCode { get; set; } + } + + /// + /// Enumerates the DataModificationOperation for the operation kind + /// + public enum DataModificationOperationKind + { + /// + /// Insert new Instance + /// + Insert, + + /// + /// Update existing Instance + /// + Update, + + /// + /// Insert new instance or update it if it already exists + /// + Upsert, + + /// + /// Delete existing instance + /// + Delete, + + /// + /// Invoke action or function + /// + Invoke, + + /// + /// Add link between entities + /// + Link, + + /// + /// Remove link between entities + /// + Unlink + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.OData.Shared/DefaultContainerBuilder.cs b/src/Microsoft.AspNet.OData.Shared/DefaultContainerBuilder.cs index 3a78c02427..d7c9022fd1 100644 --- a/src/Microsoft.AspNet.OData.Shared/DefaultContainerBuilder.cs +++ b/src/Microsoft.AspNet.OData.Shared/DefaultContainerBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/DefaultEdmPatchMethodHandler.cs b/src/Microsoft.AspNet.OData.Shared/DefaultEdmPatchMethodHandler.cs new file mode 100644 index 0000000000..8e9390c54d --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/DefaultEdmPatchMethodHandler.cs @@ -0,0 +1,161 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using Microsoft.OData.Edm; + +namespace Microsoft.AspNet.OData +{ + /// + /// This is the default Patch Handler for non CLR type. This calss has default Get, Create and Update + /// and will do these actions. This will be used when the original collection to be Patched is provided. + /// + internal class DefaultEdmODataAPIHandler : EdmODataAPIHandler + { + IEdmEntityType entityType; + ICollection originalList; + + public DefaultEdmODataAPIHandler(ICollection originalList, IEdmEntityType entityType) + { + Contract.Assert(entityType != null); + + this.entityType = entityType; + this.originalList = originalList?? new List(); + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out IEdmStructuredObject originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + Contract.Assert(keyValues != null); + + try + { + originalObject = GetFilteredItem(keyValues); + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + public override ODataAPIResponseStatus TryCreate(IEdmChangedObject changedObject, out IEdmStructuredObject createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new EdmEntityObject(entityType); + originalList.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + EdmStructuredObject originalObject = GetFilteredItem(keyValues); + + if (originalObject != null) + { + originalList.Remove(originalObject); + } + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override EdmODataAPIHandler GetNestedHandler(IEdmStructuredObject parent, string navigationPropertyName) + { + IEdmNavigationProperty navProperty = entityType.NavigationProperties().FirstOrDefault(navProp => navProp.Name == navigationPropertyName); + + if(navProperty == null) + { + return null; + } + + IEdmEntityType nestedEntityType = navProperty.ToEntityType(); + + object obj; + if(parent.TryGetPropertyValue(navigationPropertyName, out obj)) + { + ICollection nestedList = obj as ICollection; + + return new DefaultEdmODataAPIHandler(nestedList, nestedEntityType); + } + + return null; + } + + + private EdmStructuredObject GetFilteredItem(IDictionary keyValues) + { + //This logic is for filtering the object based on the set of keys, + //There will only be very few key elements usually, mostly 1, so performance wont be impacted. + + if(originalList == null) + { + return null; + } + + foreach (EdmStructuredObject item in originalList) + { + bool isMatch = true; + + foreach (KeyValuePair keyValue in keyValues) + { + object value; + if (item.TryGetPropertyValue(keyValue.Key, out value)) + { + if (!Equals(value, keyValue.Value)) + { + // Not a match, so try the next one + isMatch = false; + break; + } + } + } + + if (isMatch) + { + return item; + } + } + + return null; + } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/DefaultODataAPIHandler.cs b/src/Microsoft.AspNet.OData.Shared/DefaultODataAPIHandler.cs new file mode 100644 index 0000000000..5974ae2169 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/DefaultODataAPIHandler.cs @@ -0,0 +1,153 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Reflection; + +namespace Microsoft.AspNet.OData +{ + /// + /// This is the default ODataAPIHandler for CLR type. This calss has default Get, Create and Update + /// and will do these actions. This will be used when the original collection to be Patched is provided. + /// + /// + internal class DefaultODataAPIHandler : ODataAPIHandler where TStructuralType :class + { + Type _clrType; + ICollection originalList; + + public DefaultODataAPIHandler(ICollection originalList) + { + this._clrType = typeof(TStructuralType); + this.originalList = originalList?? new List(); + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out TStructuralType originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = default(TStructuralType); + + try + { + originalObject = GetFilteredItem(keyValues); + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out TStructuralType createdObject, out string errorMessage) + { + createdObject = default(TStructuralType); + errorMessage = string.Empty; + + try + { + if(originalList != null) + { + originalList = new List(); + } + + createdObject = Activator.CreateInstance(_clrType) as TStructuralType; + originalList.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + TStructuralType originalObject = GetFilteredItem(keyValues); + originalList.Remove(originalObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override IODataAPIHandler GetNestedHandler(TStructuralType parent, string navigationPropertyName) + { + foreach (PropertyInfo property in _clrType.GetProperties()) + { + if (property.Name == navigationPropertyName) + { + Type type = typeof(DefaultODataAPIHandler<>).MakeGenericType(property.PropertyType.GetGenericArguments()[0]); + + return Activator.CreateInstance(type, property.GetValue(parent)) as IODataAPIHandler; + } + } + + return null; + } + + + private TStructuralType GetFilteredItem(IDictionary keyValues) + { + //This logic is for filtering the object based on the set of keys, + //There will only be very few key elements usually, mostly 1, so performance wont be impacted. + + if(originalList == null || originalList.Count == 0) + { + return default(TStructuralType); + } + + Dictionary propertyInfos = new Dictionary(); + + foreach (string key in keyValues.Keys) + { + propertyInfos.Add(key, _clrType.GetProperty(key)); + } + + foreach (TStructuralType item in originalList) + { + bool isMatch = true; + + foreach (KeyValuePair keyValue in keyValues) + { + if (!Equals(propertyInfos[keyValue.Key].GetValue(item), keyValue.Value)) + { + // Not a match, so try the next one + isMatch = false; + break; + } + } + + if (isMatch) + { + return item; + } + } + + return default(TStructuralType); + } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/Delta.cs b/src/Microsoft.AspNet.OData.Shared/Delta.cs index 7675def9ae..14cf33e774 100644 --- a/src/Microsoft.AspNet.OData.Shared/Delta.cs +++ b/src/Microsoft.AspNet.OData.Shared/Delta.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -95,4 +99,4 @@ public override bool TryGetMember(GetMemberBinder binder, out object result) /// public abstract IEnumerable GetUnchangedPropertyNames(); } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/DeltaDeletedEntityObjectOfT.cs b/src/Microsoft.AspNet.OData.Shared/DeltaDeletedEntityObjectOfT.cs new file mode 100644 index 0000000000..6a249de90e --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/DeltaDeletedEntityObjectOfT.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Reflection; +using System.Threading; +using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Common; +using Microsoft.OData; +using Microsoft.OData.Edm; + +namespace Microsoft.AspNet.OData +{ + /// + /// Represents an with a backing CLR . + /// Used to hold the Deleted Entry object in the Delta Feed Payload. + /// + [NonValidatingParameterBinding] + public class DeltaDeletedEntityObject : Delta, IDeltaDeletedEntityObject where TStructuralType : class + { + /// + /// Initializes a new instance of . + /// + public DeltaDeletedEntityObject() + : this(typeof(TStructuralType)) + { + } + + /// + /// Initializes a new instance of . + /// + /// The derived entity type or complex type for which the changes would be tracked. + /// should be assignable to instances of . + /// + public DeltaDeletedEntityObject(Type structuralType) + : this(structuralType, dynamicDictionaryPropertyInfo: null, instanceAnnotationsPropertyInfo: null) + { + } + + /// + /// Initializes a new instance of . + /// + /// The derived entity type or complex type for which the changes would be tracked. + /// should be assignable to instances of . + /// + /// Properties to update + public DeltaDeletedEntityObject(Type structuralType, IEnumerable updatableProperties) + : this(structuralType, updatableProperties, dynamicDictionaryPropertyInfo: null, instanceAnnotationsPropertyInfo: null) + { + + } + + /// + /// Initializes a new instance of . + /// + /// The derived entity type or complex type for which the changes would be tracked. + /// should be assignable to instances of . + /// + /// The property info that is used as container for Instance Annotations + public DeltaDeletedEntityObject(Type structuralType, PropertyInfo instanceAnnotationsPropertyInfo) + : this(structuralType, dynamicDictionaryPropertyInfo: null, instanceAnnotationsPropertyInfo) + { + + } + + /// + /// Initializes a new instance of . + /// + /// The derived entity type or complex type for which the changes would be tracked. + /// should be assignable to instances of . + /// + /// The property info that is used as dictionary of dynamic + /// properties. null means this entity type is not open. + /// The property info that is used as container for Instance Annotations + public DeltaDeletedEntityObject(Type structuralType, PropertyInfo dynamicDictionaryPropertyInfo, PropertyInfo instanceAnnotationsPropertyInfo) + : this(structuralType, updatableProperties: null , dynamicDictionaryPropertyInfo, instanceAnnotationsPropertyInfo) + { + + } + + /// + /// Initializes a new instance of . + /// + /// The derived entity type or complex type for which the changes would be tracked. + /// should be assignable to instances of . + /// + /// Properties that can be updated + /// The property info that is used as dictionary of dynamic + /// properties. null means this entity type is not open. + /// The property info that is used as container for Instance Annotations + public DeltaDeletedEntityObject(Type structuralType, IEnumerable updatableProperties, PropertyInfo dynamicDictionaryPropertyInfo, PropertyInfo instanceAnnotationsPropertyInfo) + : base(structuralType, updatableProperties, dynamicDictionaryPropertyInfo, instanceAnnotationsPropertyInfo) + { + DeltaKind = EdmDeltaEntityKind.DeletedEntry; + } + + /// + public Uri Id { get; set; } + + /// + public DeltaDeletedEntryReason? Reason { get; set; } + + /// + public IEdmNavigationSource NavigationSource { get; set; } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.OData.Shared/DeltaOfTStructuralType.cs b/src/Microsoft.AspNet.OData.Shared/DeltaOfTStructuralType.cs index 64c5830fbd..58fa120892 100644 --- a/src/Microsoft.AspNet.OData.Shared/DeltaOfTStructuralType.cs +++ b/src/Microsoft.AspNet.OData.Shared/DeltaOfTStructuralType.cs @@ -1,7 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; +using System.Collections; using System.Collections.Concurrent; using System.Collections.Generic; using System.Diagnostics; @@ -10,9 +15,11 @@ using System.Linq; using System.Reflection; using System.Runtime.CompilerServices; +using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Builder.Conventions.Attributes; using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Formatter; +using Microsoft.OData.Edm; namespace Microsoft.AspNet.OData { @@ -21,14 +28,14 @@ namespace Microsoft.AspNet.OData /// /// TStructuralType is the type of the instance this delta tracks changes for. [NonValidatingParameterBinding] - public class Delta : TypedDelta, IDelta where TStructuralType : class + public class Delta : TypedDelta, IDelta, IDeltaSetItem where TStructuralType : class { // cache property accessors for this type and all its derived types. - private static ConcurrentDictionary>> _propertyCache + private static readonly ConcurrentDictionary>> _propertyCache = new ConcurrentDictionary>>(); private Dictionary> _allProperties; - private HashSet _updatableProperties; + private List _updatableProperties; private HashSet _changedProperties; @@ -38,10 +45,12 @@ private static ConcurrentDictionary _changedDynamicProperties; private IDictionary _dynamicDictionaryCache; - + private NavigationPath _navigationPath; + /// /// Initializes a new instance of . /// @@ -70,8 +79,24 @@ public Delta(Type structuralType) /// The set of properties that can be updated or reset. Unknown property /// names, including those of dynamic properties, are ignored. public Delta(Type structuralType, IEnumerable updatableProperties) - : this(structuralType, updatableProperties: updatableProperties, dynamicDictionaryPropertyInfo: null) + : this(structuralType, updatableProperties: updatableProperties, dynamicDictionaryPropertyInfo: null, instanceAnnotationsPropertyInfo:null) + { + } + + /// + /// Initializes a new instance of . + /// + /// The derived entity type or complex type for which the changes would be tracked. + /// should be assignable to instances of . + /// + /// The set of properties that can be updated or reset. Unknown property + /// names, including those of dynamic properties, are ignored. + /// The property info that is used as dictionary of dynamic + /// properties. null means this entity type is not open. + public Delta(Type structuralType, IEnumerable updatableProperties, PropertyInfo dynamicDictionaryPropertyInfo) + : this(structuralType, updatableProperties: updatableProperties, dynamicDictionaryPropertyInfo, instanceAnnotationsPropertyInfo: null) { + } /// @@ -83,29 +108,54 @@ public Delta(Type structuralType, IEnumerable updatableProperties) /// The set of properties that can be updated or reset. Unknown property /// names, including those of dynamic properties, are ignored. /// The property info that is used as dictionary of dynamic - /// properties. null means this entity type is not open. + /// properties. null means this entity type is not open. + /// The property info that is used as container for Instance Annotations public Delta(Type structuralType, IEnumerable updatableProperties, - PropertyInfo dynamicDictionaryPropertyInfo) + PropertyInfo dynamicDictionaryPropertyInfo, PropertyInfo instanceAnnotationsPropertyInfo) { _dynamicDictionaryPropertyinfo = dynamicDictionaryPropertyInfo; Reset(structuralType); - InitializeProperties(updatableProperties); + InitializeProperties(updatableProperties); + TransientInstanceAnnotationContainer = new ODataInstanceAnnotationContainer(); + _instanceAnnotationsPropertyInfo = instanceAnnotationsPropertyInfo; + _navigationPath = new NavigationPath(structuralType.Name, null); + DeltaKind = EdmDeltaEntityKind.Entry; } /// public override Type StructuredType + => _structuredType; + + internal IDictionary DeltaNestedResources { - get - { - return _structuredType; - } + get { return _deltaNestedResources; } } /// public override Type ExpectedClrType - { - get { return typeof(TStructuralType); } - } + => typeof(TStructuralType); + + /// + /// The list of property names that can be updated. + /// + /// When the list is modified, any modified properties that were removed from the list are no longer + /// considered to be changed. + public IList UpdatableProperties + => _updatableProperties; + + /// + /// Gets the enum type of . + /// + public EdmDeltaEntityKind DeltaKind { get; protected set; } + + /// + public IODataInstanceAnnotationContainer TransientInstanceAnnotationContainer { get; set; } + + /// + public ODataIdContainer ODataIdContainer { get; set; } + + /// + internal PropertyInfo InstanceAnnotationsPropertyInfo { get { return _instanceAnnotationsPropertyInfo; } } /// public override void Clear() @@ -116,11 +166,24 @@ public override void Clear() /// public override bool TrySetPropertyValue(string name, object value) { - if (string.IsNullOrWhiteSpace(name)) + if (String.IsNullOrWhiteSpace(name)) { throw Error.ArgumentNull("name"); } + if (_instanceAnnotationsPropertyInfo != null && name == _instanceAnnotationsPropertyInfo.Name) + { + IODataInstanceAnnotationContainer annotationValue = value as IODataInstanceAnnotationContainer; + if (value != null && annotationValue == null) + { + return false; + } + + _instanceAnnotationsPropertyInfo.SetValue(_instance, annotationValue); + + return true; + } + if (_dynamicDictionaryPropertyinfo != null) { // Dynamic property can have the same name as the dynamic property dictionary. @@ -139,7 +202,7 @@ public override bool TrySetPropertyValue(string name, object value) } } - if (value is IDelta) + if (value is IDelta || value is IDeltaSet) { return TrySetNestedResourceInternal(name, value); } @@ -157,6 +220,19 @@ public override bool TryGetPropertyValue(string name, out object value) throw Error.ArgumentNull("name"); } + if (_instanceAnnotationsPropertyInfo != null && name == _instanceAnnotationsPropertyInfo.Name) + { + object propertyValue = _instanceAnnotationsPropertyInfo.GetValue(_instance); + if (propertyValue != null) + { + value = (IODataInstanceAnnotationContainer)propertyValue; + return true; + } + + value = null; + return false; + } + if (_dynamicDictionaryPropertyinfo != null) { if (_dynamicDictionaryCache == null) @@ -171,12 +247,20 @@ public override bool TryGetPropertyValue(string name, out object value) } } - if (this._deltaNestedResources.ContainsKey(name)) + if (_deltaNestedResources.ContainsKey(name)) { // If this is a nested resource, get the value from the dictionary of nested resources. object deltaNestedResource = _deltaNestedResources[name]; Contract.Assert(deltaNestedResource != null, "deltaNestedResource != null"); + + //If DeltaSet collection, we are handling delta collections so the value will be that itself and no need to get instance value + if (deltaNestedResource is IDeltaSet) + { + value = deltaNestedResource; + return true; + } + Contract.Assert(IsDeltaOfT(deltaNestedResource.GetType())); // Get the Delta<{NestedResourceType}>._instance using Reflection. @@ -259,7 +343,7 @@ public TStructuralType GetInstance() /// public override IEnumerable GetChangedPropertyNames() { - return _changedProperties.Concat(_deltaNestedResources.Keys); + return _changedProperties.Intersect(_updatableProperties).Concat(_deltaNestedResources.Keys); } /// @@ -269,7 +353,8 @@ public override IEnumerable GetChangedPropertyNames() /// public override IEnumerable GetUnchangedPropertyNames() { - return _updatableProperties.Except(GetChangedPropertyNames()); + // UpdatableProperties could include arbitrary strings, filter by _allProperties + return _updatableProperties.Intersect(_allProperties.Keys).Except(GetChangedPropertyNames()); } /// @@ -278,6 +363,13 @@ public override IEnumerable GetUnchangedPropertyNames() /// /// The entity to be updated. public void CopyChangedValues(TStructuralType original) + { + CopyChangedValues(original, null); + } + + [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity")] + [SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + internal void CopyChangedValues(TStructuralType original, ODataAPIHandler apiHandler = null, ODataAPIHandlerFactory apiHandlerFactory = null) { if (original == null) { @@ -291,11 +383,17 @@ public void CopyChangedValues(TStructuralType original) throw Error.Argument("original", SRResources.DeltaTypeMismatch, _structuredType, original.GetType()); } + //To apply ODataId if its present + if (apiHandlerFactory != null && ODataIdContainer?.ODataIdNavigationPath != null) + { + ApplyODataId(original, apiHandlerFactory); + } + RuntimeHelpers.EnsureSufficientExecutionStack(); // For regular non-structural properties at current level. PropertyAccessor[] propertiesToCopy = - this._changedProperties.Select(s => _allProperties[s]).ToArray(); + _changedProperties.Intersect(_updatableProperties).Select(s => _allProperties[s]).ToArray(); foreach (PropertyAccessor propertyToCopy in propertiesToCopy) { propertyToCopy.Copy(_instance, original); @@ -309,31 +407,45 @@ public void CopyChangedValues(TStructuralType original) // Patch for each nested resource changed under this TStructuralType. dynamic deltaNestedResource = _deltaNestedResources[nestedResourceName]; dynamic originalNestedResource = null; - if (!TryGetPropertyRef(original, nestedResourceName, out originalNestedResource)) - { - throw Error.Argument(nestedResourceName, SRResources.DeltaNestedResourceNameNotFound, - nestedResourceName, original.GetType()); - } - if (originalNestedResource == null) + if(deltaNestedResource is IDeltaSet) { - // When patching original target of null value, directly set nested resource. - dynamic deltaObject = _deltaNestedResources[nestedResourceName]; - dynamic instance = deltaObject.GetInstance(); - - // Recursively patch up the instance with the nested resources. - deltaObject.CopyChangedValues(instance); + IODataAPIHandler apiHandlerNested = apiHandler.GetNestedHandler(original, nestedResourceName); - _allProperties[nestedResourceName].SetValue(original, instance); + if (apiHandlerNested != null) + { + deltaNestedResource.CopyChangedValues(apiHandlerNested, apiHandlerFactory); + } } else { - // Recursively patch the subtree. - bool isDeltaType = TypedDelta.IsDeltaOfT(deltaNestedResource.GetType()); - Contract.Assert(isDeltaType, nestedResourceName + "'s corresponding value should be Delta type but is not."); + if (!TryGetPropertyRef(original, nestedResourceName, out originalNestedResource)) + { + throw Error.Argument(nestedResourceName, SRResources.DeltaNestedResourceNameNotFound, + nestedResourceName, original.GetType()); + } + + if (originalNestedResource == null) + { + // When patching original target of null value, directly set nested resource. + dynamic deltaObject = _deltaNestedResources[nestedResourceName]; + dynamic instance = deltaObject.GetInstance(); + + // Recursively patch up the instance with the nested resources. + deltaObject.CopyChangedValues(instance); - deltaNestedResource.CopyChangedValues(originalNestedResource); + _allProperties[nestedResourceName].SetValue(original, instance); + } + else + { + //Recursively patch the subtree. + bool isDeltaType = TypedDelta.IsDeltaOfT(deltaNestedResource.GetType()); + Contract.Assert(isDeltaType, nestedResourceName + "'s corresponding value should be Delta type but is not."); + + deltaNestedResource.CopyChangedValues(originalNestedResource); + } } + } } @@ -373,6 +485,51 @@ public void Patch(TStructuralType original) CopyChangedValues(original); } + /// + /// Overwrites the entity with the changes tracked by this Delta. + /// The semantics of this operation are equivalent to a HTTP PATCH operation, hence the name. + /// + /// The entity to be updated. + /// API Handler Factory + public void Patch(TStructuralType original, ODataAPIHandlerFactory apiHandlerFactory) + { + IODataAPIHandler apiHandler = apiHandlerFactory.GetHandler(_navigationPath); + + Debug.Assert(apiHandler != null); + + CopyChangedValues(original, apiHandler as ODataAPIHandler, apiHandlerFactory); + } + + /// + /// This is basically Patch on ODataId. This applies ODataId parsed Navigation paths, get the value identified by that and copy it on original object + /// + private void ApplyODataId(TStructuralType original, ODataAPIHandlerFactory apiHandlerFactory) + { + IODataAPIHandler refapiHandler = apiHandlerFactory.GetHandler(ODataIdContainer.ODataIdNavigationPath); + + if (refapiHandler != null) + { + ODataAPIHandler refapiHandlerOfT = refapiHandler as ODataAPIHandler; + + Debug.Assert(refapiHandlerOfT != null); + + TStructuralType referencedObj; + string error; + + //Checking to get the referenced entity, get the properties and apply it on original object + if (refapiHandlerOfT.TryGet(ODataIdContainer.ODataIdNavigationPath.GetNavigationPathItems().Last().KeyProperties, out referencedObj, out error) == ODataAPIResponseStatus.Success) + { + foreach (string property in _updatableProperties) + { + PropertyInfo propertyInfo = _structuredType.GetProperty(property); + + object value = propertyInfo.GetValue(referencedObj); + propertyInfo.SetValue(original, value); + } + } + } + } + /// /// Overwrites the entity with the values stored in this Delta. /// The semantics of this operation are equivalent to a HTTP PUT operation, hence the name. @@ -502,15 +659,14 @@ private void InitializeProperties(IEnumerable updatableProperties) .Where(p => (p.GetSetMethod() != null || TypeHelper.IsCollection(p.PropertyType)) && p.GetGetMethod() != null) .Select>(p => new FastPropertyAccessor(p)) .ToDictionary(p => p.Property.Name)); - + if (updatableProperties != null) { - _updatableProperties = new HashSet(updatableProperties); - _updatableProperties.IntersectWith(_allProperties.Keys); + _updatableProperties = updatableProperties.Intersect(_allProperties.Keys).ToList(); } else { - _updatableProperties = new HashSet(_allProperties.Keys); + _updatableProperties = new List(_allProperties.Keys); } if (_dynamicDictionaryPropertyinfo != null) @@ -625,7 +781,7 @@ private bool TrySetPropertyValueInternal(string name, object value) throw Error.ArgumentNull("name"); } - if (!_updatableProperties.Contains(name)) + if (!(_allProperties.ContainsKey(name) && _updatableProperties.Contains(name))) { return false; } @@ -655,7 +811,7 @@ private bool TrySetNestedResourceInternal(string name, object deltaNestedResourc throw Error.ArgumentNull("name"); } - if (!_updatableProperties.Contains(name)) + if (!(_allProperties.ContainsKey(name) && _updatableProperties.Contains(name))) { return false; } @@ -666,11 +822,16 @@ private bool TrySetNestedResourceInternal(string name, object deltaNestedResourc return false; } - PropertyAccessor cacheHit = _allProperties[name]; - // Get the Delta<{NestedResourceType}>._instance using Reflection. - FieldInfo field = deltaNestedResource.GetType().GetField("_instance", BindingFlags.NonPublic | BindingFlags.Instance); - Contract.Assert(field != null, "field != null"); - cacheHit.SetValue(_instance, field.GetValue(deltaNestedResource)); + //If Edmchangedobject collection, we are handling delta collections so the instance value need not be set, + //as we consider the value as collection of Delta itself and not instance value of the field + if (!(deltaNestedResource is IDeltaSet)) + { + PropertyAccessor cacheHit = _allProperties[name]; + // Get the Delta<{NestedResourceType}>._instance using Reflection. + FieldInfo field = deltaNestedResource.GetType().GetField("_instance", BindingFlags.NonPublic | BindingFlags.Instance); + Contract.Assert(field != null, "field != null"); + cacheHit.SetValue(_instance, field.GetValue(deltaNestedResource)); + } // Add the nested resource in the hierarchy. // Note: We shouldn't add the structural properties to the _changedProperties, which @@ -680,4 +841,4 @@ private bool TrySetNestedResourceInternal(string name, object deltaNestedResourc return true; } } -} +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.OData.Shared/DeltaSetOfT.cs b/src/Microsoft.AspNet.OData.Shared/DeltaSetOfT.cs new file mode 100644 index 0000000000..2d1e4f9f19 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/DeltaSetOfT.cs @@ -0,0 +1,342 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Reflection; +using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Common; +using Org.OData.Core.V1; + +namespace Microsoft.AspNet.OData +{ + /// + /// Represents an that is a collection of s. + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1710:IdentifiersShouldHaveCorrectSuffix")] + [NonValidatingParameterBinding] + public class DeltaSet : Collection, IDeltaSet where TStructuralType : class + { + private Type _clrType; + IList _keys; + NavigationPath _navigationPath; + + /// + /// Initializes a new instance of the class. + /// + /// List of key names for the type + public DeltaSet(IList keys) + { + _keys = keys; + _clrType = typeof(TStructuralType); + _navigationPath = new NavigationPath(_clrType.Name, null); + } + + + /// + protected override void InsertItem(int index, IDeltaSetItem item) + { + Delta deltaItem = item as Delta; + + //To ensure we dont insert null or a non related type to deltaset + if (deltaItem == null) + { + throw Error.Argument("item", SRResources.ChangedObjectTypeMismatch, item.GetType(), _clrType); + } + + base.InsertItem(index, item); + } + + + /// + /// Patch for DeltaSet, a collection for Delta + /// + /// Original collection of the Type which needs to be updated + /// /// DeltaSet response + public DeltaSet Patch(ICollection originalCollection) + { + ODataAPIHandler apiHandler = new DefaultODataAPIHandler(originalCollection); + + return CopyChangedValues(apiHandler); + } + + + /// + /// Patch for DeltaSet, a collection for Delta + /// + /// DeltaSet response + public DeltaSet Patch(ODataAPIHandlerFactory apiHandlerFactory) + { + IODataAPIHandler apiHandler = apiHandlerFactory.GetHandler(_navigationPath); + ODataAPIHandler apiHandlerOfT = apiHandler as ODataAPIHandler; + Debug.Assert(apiHandlerOfT != null); + + return CopyChangedValues(apiHandlerOfT, apiHandlerFactory); + } + + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + internal DeltaSet CopyChangedValues(IODataAPIHandler apiHandler, ODataAPIHandlerFactory apiHandlerFactory = null) + { + //Here we are getting the keys and using the keys to find the original object + //to patch from the list of collection + + ODataAPIHandler apiHandlerOfT = apiHandler as ODataAPIHandler; + + Debug.Assert(apiHandlerOfT != null); + + DeltaSet deltaSet = CreateDeltaSet(); + + foreach (Delta changedObj in Items) + { + DataModificationOperationKind operation = DataModificationOperationKind.Update; + + //Get filtered item based on keys + TStructuralType original = null; + string errorMessage = string.Empty; + string getErrorMessage = string.Empty; + + Dictionary keyValues = new Dictionary(); + + foreach (string key in _keys) + { + object value; + + if (changedObj.TryGetPropertyValue(key, out value)) + { + keyValues.Add(key, value); + } + } + + try + { + ODataAPIResponseStatus ODataAPIResponseStatus = apiHandlerOfT.TryGet(keyValues, out original, out getErrorMessage); + + DeltaDeletedEntityObject deletedObj = changedObj as DeltaDeletedEntityObject; + + if (ODataAPIResponseStatus == ODataAPIResponseStatus.Failure || (deletedObj != null && ODataAPIResponseStatus == ODataAPIResponseStatus.NotFound)) + { + IDeltaSetItem deltaSetItem = changedObj; + + DataModificationExceptionType dataModificationExceptionType = new DataModificationExceptionType(operation); + dataModificationExceptionType.MessageType = new MessageType { Message = getErrorMessage }; + + deltaSetItem.TransientInstanceAnnotationContainer.AddResourceAnnotation(SRResources.DataModificationException, dataModificationExceptionType); + + deltaSet.Add(deltaSetItem); + + continue; + } + + if (deletedObj != null) + { + operation = DataModificationOperationKind.Delete; + + changedObj.CopyChangedValues(original, apiHandlerOfT, apiHandlerFactory); + + if (apiHandlerOfT.TryDelete(keyValues, out errorMessage) != ODataAPIResponseStatus.Success) + { + //Handle Failed Operation - Delete + + if (ODataAPIResponseStatus == ODataAPIResponseStatus.Success) + { + IDeltaSetItem changedObject = HandleFailedOperation(changedObj, operation, original, errorMessage); + deltaSet.Add(changedObject); + continue; + } + } + + deltaSet.Add(deletedObj); + } + else + { + if (ODataAPIResponseStatus == ODataAPIResponseStatus.NotFound) + { + operation = DataModificationOperationKind.Insert; + + if (apiHandlerOfT.TryCreate(keyValues, out original, out errorMessage) != ODataAPIResponseStatus.Success) + { + //Handle failed Opreataion - create + IDeltaSetItem changedObject = HandleFailedOperation(changedObj, operation, original, errorMessage); + deltaSet.Add(changedObject); + continue; + } + } + else if (ODataAPIResponseStatus == ODataAPIResponseStatus.Success) + { + operation = DataModificationOperationKind.Update; + } + else + { + //Handle failed operation + IDeltaSetItem changedObject = HandleFailedOperation(changedObj, operation, original, getErrorMessage); + deltaSet.Add(changedObject); + continue; + } + + //Patch for addition/update. This will call Delta for each item in the collection + // This will work in case we use delegates for using users method to create an object + changedObj.CopyChangedValues(original, apiHandlerOfT, apiHandlerFactory); + + deltaSet.Add(changedObj); + } + } + catch (Exception ex) + { + //For handling the failed operations. + IDeltaSetItem changedObject = HandleFailedOperation(changedObj, operation, original, ex.Message); + deltaSet.Add(changedObject); + } + } + + return deltaSet; + } + + private DeltaSet CreateDeltaSet() + { + Type type = typeof(DeltaSet<>).MakeGenericType(_clrType); + + return Activator.CreateInstance(type, _keys) as DeltaSet; + } + + private IDeltaSetItem HandleFailedOperation(Delta changedObj, DataModificationOperationKind operation, TStructuralType originalObj, string errorMessage) + { + IDeltaSetItem deltaSetItem = null; + DataModificationExceptionType dataModificationExceptionType = new DataModificationExceptionType(operation); + dataModificationExceptionType.MessageType = new MessageType { Message = errorMessage }; + + // This handles the Data Modification exception. This adds Core.DataModificationException annotation and also copy other instance annotations. + //The failed operation will be based on the protocol + switch (operation) + { + case DataModificationOperationKind.Update: + deltaSetItem = changedObj; + break; + case DataModificationOperationKind.Insert: + { + deltaSetItem = CreateDeletedEntityForFailedOperation(changedObj); + + break; + } + case DataModificationOperationKind.Delete: + { + deltaSetItem = CreateEntityObjectForFailedOperation(changedObj, originalObj); + break; + } + } + + + deltaSetItem.TransientInstanceAnnotationContainer = changedObj.TransientInstanceAnnotationContainer; + deltaSetItem.TransientInstanceAnnotationContainer.AddResourceAnnotation(SRResources.DataModificationException, dataModificationExceptionType); + + Contract.Assert(deltaSetItem != null); + + return deltaSetItem; + } + + private IDeltaSetItem CreateEntityObjectForFailedOperation(Delta changedObj, TStructuralType originalObj) + { + Type type = typeof(Delta<>).MakeGenericType(_clrType); + + Delta deltaObject = Activator.CreateInstance(type, _clrType, null, null, + changedObj.InstanceAnnotationsPropertyInfo) as Delta; + + SetProperties(originalObj, deltaObject); + + if (deltaObject.InstanceAnnotationsPropertyInfo != null) + { + object instAnnValue; + changedObj.TryGetPropertyValue(deltaObject.InstanceAnnotationsPropertyInfo.Name, out instAnnValue); + if (instAnnValue != null) + { + IODataInstanceAnnotationContainer instanceAnnotations = instAnnValue as IODataInstanceAnnotationContainer; + + if (instanceAnnotations != null) + { + deltaObject.TrySetPropertyValue(deltaObject.InstanceAnnotationsPropertyInfo.Name, instanceAnnotations); + } + } + } + + return deltaObject; + } + + private void SetProperties(TStructuralType originalObj, Delta edmDeltaEntityObject) + { + foreach (string property in edmDeltaEntityObject.GetUnchangedPropertyNames()) + { + edmDeltaEntityObject.TrySetPropertyValue(property, _clrType.GetProperty(property).GetValue(originalObj)); + } + } + + private DeltaDeletedEntityObject CreateDeletedEntityForFailedOperation(Delta changedObj) + { + Type type = typeof(DeltaDeletedEntityObject<>).MakeGenericType(changedObj.ExpectedClrType); + + DeltaDeletedEntityObject deletedObject = Activator.CreateInstance(type, true, changedObj.InstanceAnnotationsPropertyInfo) as DeltaDeletedEntityObject; + + foreach (string property in changedObj.GetChangedPropertyNames()) + { + SetPropertyValues(changedObj, deletedObject, property); + } + + foreach (string property in changedObj.GetUnchangedPropertyNames()) + { + SetPropertyValues(changedObj, deletedObject, property); + } + + object annValue; + if (changedObj.TryGetPropertyValue(changedObj.InstanceAnnotationsPropertyInfo.Name, out annValue)) + { + IODataInstanceAnnotationContainer instanceAnnotations = annValue as IODataInstanceAnnotationContainer; + + if (instanceAnnotations != null) + { + deletedObject.TrySetPropertyValue(changedObj.InstanceAnnotationsPropertyInfo.Name, instanceAnnotations); + } + } + + deletedObject.TransientInstanceAnnotationContainer = changedObj.TransientInstanceAnnotationContainer; + + ValidateForDeletedEntityId(_keys, deletedObject); + + return deletedObject; + } + + //This is for ODL to work to set id as empty, because if there are missing keys, id wouldnt be set and we need to set it as empty. + private static void ValidateForDeletedEntityId(IList keys, DeltaDeletedEntityObject edmDeletedObject) + { + bool hasnullKeys = false; + for (int i = 0; i < keys.Count; i++) + { + object value; + edmDeletedObject.TryGetPropertyValue(keys[i], out value); + + if (value == null) + { + hasnullKeys = true; + break; + } + } + + if (hasnullKeys) + { + edmDeletedObject.Id = new Uri(string.Empty); + } + } + + private static void SetPropertyValues(Delta changedObj, DeltaDeletedEntityObject edmDeletedObject, string property) + { + object objectVal; + if (changedObj.TryGetPropertyValue(property, out objectVal)) + { + edmDeletedObject.TrySetPropertyValue(property, objectVal); + } + } + } +} \ No newline at end of file diff --git a/src/Microsoft.AspNet.OData.Shared/ETagMessageHandler.cs b/src/Microsoft.AspNet.OData.Shared/ETagMessageHandler.cs index 003071384c..e60f8f5b55 100644 --- a/src/Microsoft.AspNet.OData.Shared/ETagMessageHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/ETagMessageHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/EdmChangedObjectCollection.cs b/src/Microsoft.AspNet.OData.Shared/EdmChangedObjectCollection.cs index 1af4915c28..82a7b9758e 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmChangedObjectCollection.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmChangedObjectCollection.cs @@ -1,11 +1,22 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ +using System; +using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Diagnostics; +using System.Diagnostics.Contracts; using System.Linq; +using System.Net.Http.Headers; using Microsoft.AspNet.OData.Common; +using Microsoft.OData; using Microsoft.OData.Edm; +using Org.OData.Core.V1; namespace Microsoft.AspNet.OData { @@ -18,7 +29,8 @@ public class EdmChangedObjectCollection : Collection, IEdmObj private IEdmEntityType _entityType; private EdmDeltaCollectionType _edmType; private IEdmCollectionTypeReference _edmTypeReference; - + private NavigationPath _navigationPath; + /// /// Initializes a new instance of the class. /// @@ -39,7 +51,13 @@ public EdmChangedObjectCollection(IEdmEntityType entityType, IList + /// Represents EntityType of the changedobject + /// + public IEdmEntityType EntityType { get { return _entityType; } } + /// public IEdmTypeReference GetEdmType() { @@ -56,6 +74,321 @@ private void Initialize(IEdmEntityType entityType) _entityType = entityType; _edmType = new EdmDeltaCollectionType(new EdmEntityTypeReference(_entityType, isNullable: true)); _edmTypeReference = new EdmCollectionTypeReference(_edmType); + _navigationPath = new NavigationPath(entityType.Name, null); + } + + /// + /// Patch for Types without underlying CLR types + /// + /// + /// ChangedObjectCollection response + internal EdmChangedObjectCollection Patch(ICollection originalCollection) + { + EdmODataAPIHandler apiHandler = new DefaultEdmODataAPIHandler(originalCollection, _entityType); + + return CopyChangedValues(apiHandler); + } + + /// + /// Patch for EdmChangedObjectCollection, a collection for IEdmChangedObject + /// + /// ChangedObjectCollection response + public EdmChangedObjectCollection Patch(ODataEdmAPIHandlerFactory apiHandlerFactory) + { + EdmODataAPIHandler apiHandler = apiHandlerFactory.GetHandler(_navigationPath); + + return CopyChangedValues(apiHandler, apiHandlerFactory); + } + + + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Performance", "CA1800:DoNotCastUnnecessarily")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] + internal EdmChangedObjectCollection CopyChangedValues(EdmODataAPIHandler apiHandler, ODataEdmAPIHandlerFactory apiHandlerFactory = null) + { + EdmChangedObjectCollection changedObjectCollection = new EdmChangedObjectCollection(_entityType); + IEdmStructuralProperty[] keys = _entityType.Key().ToArray(); + + foreach (IEdmChangedObject changedObj in Items) + { + DataModificationOperationKind operation = DataModificationOperationKind.Update; + EdmStructuredObject originalObj = null; + string errorMessage = string.Empty; + string getErrorMessage = string.Empty; + IDictionary keyValues = GetKeyValues(keys, changedObj); + + try + { + IEdmStructuredObject original = null; + EdmDeltaDeletedEntityObject deletedObj = changedObj as EdmDeltaDeletedEntityObject; + + ODataAPIResponseStatus ODataAPIResponseStatus = apiHandler.TryGet(keyValues, out original, out getErrorMessage); + + if (ODataAPIResponseStatus == ODataAPIResponseStatus.Failure || (deletedObj != null && ODataAPIResponseStatus == ODataAPIResponseStatus.NotFound)) + { + DataModificationExceptionType dataModificationExceptionType = new DataModificationExceptionType(operation); + dataModificationExceptionType.MessageType = new MessageType { Message = getErrorMessage }; + + deletedObj.TransientInstanceAnnotationContainer.AddResourceAnnotation(SRResources.DataModificationException, dataModificationExceptionType); + + changedObjectCollection.Add(deletedObj); + + continue; + } + + if (deletedObj != null) + { + operation = DataModificationOperationKind.Delete; + + PatchItem(deletedObj, original as EdmStructuredObject, apiHandler, apiHandlerFactory); + + if (apiHandler.TryDelete(keyValues, out errorMessage) != ODataAPIResponseStatus.Success) + { + //Handle Failed Operation - Delete + if (ODataAPIResponseStatus == ODataAPIResponseStatus.Success) + { + IEdmChangedObject changedObject = HandleFailedOperation(deletedObj, operation, original, keys, errorMessage, apiHandler); + changedObjectCollection.Add(changedObject); + continue; + } + } + + + + changedObjectCollection.Add(deletedObj); + } + else + { + EdmEntityObject deltaEntityObject = changedObj as EdmEntityObject; + + if (ODataAPIResponseStatus == ODataAPIResponseStatus.NotFound) + { + operation = DataModificationOperationKind.Insert; + + if (apiHandler.TryCreate(changedObj, out original, out errorMessage) != ODataAPIResponseStatus.Success) + { + //Handle failed Opreataion - create + IEdmChangedObject changedObject = HandleFailedOperation(deltaEntityObject, operation, original, keys, errorMessage, apiHandler); + changedObjectCollection.Add(changedObject); + continue; + } + } + else if (ODataAPIResponseStatus == ODataAPIResponseStatus.Success) + { + operation = DataModificationOperationKind.Update; + } + else + { + //Handle failed operation + IEdmChangedObject changedObject = HandleFailedOperation(deltaEntityObject, operation, null, keys, getErrorMessage, apiHandler); + changedObjectCollection.Add(changedObject); + continue; + } + + //Patch for addition/update. + PatchItem(deltaEntityObject, original as EdmStructuredObject, apiHandler, apiHandlerFactory); + + changedObjectCollection.Add(changedObj); + } + } + catch (Exception ex) + { + //Handle Failed Operation + IEdmChangedObject changedObject = HandleFailedOperation(changedObj as EdmEntityObject, operation, originalObj, keys, ex.Message, apiHandler); + + Contract.Assert(changedObject != null); + changedObjectCollection.Add(changedObject); + } + } + + return changedObjectCollection; + } + + private static IDictionary GetKeyValues(IEdmStructuralProperty [] keys, IEdmChangedObject changedObj) + { + IDictionary keyValues = new Dictionary(); + + foreach (IEdmStructuralProperty key in keys) + { + object value; + changedObj.TryGetPropertyValue(key.Name, out value); + + if (value != null) + { + keyValues.Add(key.Name, value); + } + } + + return keyValues; + } + + private void PatchItem(EdmStructuredObject changedObj, EdmStructuredObject originalObj, EdmODataAPIHandler apiHandler, ODataEdmAPIHandlerFactory apiHandlerFactory = null) + { + if(apiHandlerFactory!= null && changedObj is EdmEntityObject entityObject && entityObject.ODataIdContainer != null) + { + ApplyODataId(entityObject.ODataIdContainer, originalObj, apiHandlerFactory); + } + + foreach (string propertyName in changedObj.GetChangedPropertyNames()) + { + ApplyProperties(changedObj, originalObj, propertyName, apiHandler, apiHandlerFactory); + } + } + + /// + /// This applies ODataId parsed Navigation paths, get the value identified by that and copy it on original object, for typeless entities + /// + private void ApplyODataId(ODataIdContainer container, EdmStructuredObject original, ODataEdmAPIHandlerFactory apiHandlerFactory) + { + EdmODataAPIHandler edmApiHandler = apiHandlerFactory.GetHandler(container.ODataIdNavigationPath); + + if(edmApiHandler == null) + { + return; + } + + IEdmStructuredObject referencedObj; + string error; + + if (edmApiHandler.TryGet(container.ODataIdNavigationPath.GetNavigationPathItems().Last().KeyProperties, out referencedObj, out error) == ODataAPIResponseStatus.Success) + { + EdmStructuredObject structuredObj = referencedObj as EdmStructuredObject; + + foreach (string propertyName in structuredObj.GetChangedPropertyNames()) + { + ApplyProperties(structuredObj, original, propertyName, edmApiHandler, apiHandlerFactory); + } + + foreach (string propertyName in structuredObj.GetUnchangedPropertyNames()) + { + ApplyProperties(structuredObj, original, propertyName, edmApiHandler, apiHandlerFactory); + } + } + } + + + private void ApplyProperties(EdmStructuredObject changedObj, EdmStructuredObject originalObj, string propertyName, EdmODataAPIHandler apiHandler, ODataEdmAPIHandlerFactory apiHandlerFactory = null) + { + object value; + if (changedObj.TryGetPropertyValue(propertyName, out value)) + { + EdmChangedObjectCollection changedColl = value as EdmChangedObjectCollection; + if (changedColl != null) + { + EdmODataAPIHandler apiHandlerNested = apiHandler.GetNestedHandler(originalObj, propertyName); + if (apiHandlerNested != null) + { + changedColl.CopyChangedValues(apiHandlerNested, apiHandlerFactory); + } + else + { + object obj; + originalObj.TryGetPropertyValue(propertyName, out obj); + + ICollection edmColl = obj as ICollection; + + changedColl.Patch(edmColl); + } + } + else + { + //call patchitem if its single structuredobj + EdmStructuredObject structuredObj = value as EdmStructuredObject; + + if (structuredObj != null) + { + object obj; + originalObj.TryGetPropertyValue(propertyName, out obj); + + EdmStructuredObject origStructuredObj = obj as EdmStructuredObject; + + if(origStructuredObj == null) + { + if(structuredObj is EdmComplexObject) + { + origStructuredObj = new EdmComplexObject(structuredObj.ActualEdmType as IEdmComplexType); + } + else + { + origStructuredObj = new EdmEntityObject(structuredObj.ActualEdmType as IEdmEntityType); + } + + originalObj.TrySetPropertyValue(propertyName, origStructuredObj); + } + + PatchItem(structuredObj, origStructuredObj, apiHandler, apiHandlerFactory); + } + else + { + originalObj.TrySetPropertyValue(propertyName, value); + } + } + } + } + + private IEdmChangedObject HandleFailedOperation(EdmEntityObject changedObj, DataModificationOperationKind operation, IEdmStructuredObject originalObj, + IEdmStructuralProperty[] keys, string errorMessage, EdmODataAPIHandler apiHandler) + { + IEdmChangedObject edmChangedObject = null; + DataModificationExceptionType dataModificationExceptionType = new DataModificationExceptionType(operation); + dataModificationExceptionType.MessageType = new MessageType { Message = errorMessage }; + + // This handles the Data Modification exception. This adds Core.DataModificationException annotation and also copy other instance annotations. + //The failed operation will be based on the protocol + switch (operation) + { + case DataModificationOperationKind.Update: + edmChangedObject = changedObj as IEdmChangedObject; + break; + case DataModificationOperationKind.Insert: + { + EdmDeltaDeletedEntityObject edmDeletedObject = new EdmDeltaDeletedEntityObject(EntityType); + PatchItem(edmDeletedObject, changedObj, apiHandler); + + ValidateForDeletedEntityId(keys, edmDeletedObject); + + edmDeletedObject.TransientInstanceAnnotationContainer = changedObj.TransientInstanceAnnotationContainer; + edmDeletedObject.PersistentInstanceAnnotationsContainer = changedObj.PersistentInstanceAnnotationsContainer; + + edmDeletedObject.AddDataException(dataModificationExceptionType); + edmChangedObject = edmDeletedObject; + break; + } + case DataModificationOperationKind.Delete: + { + EdmDeltaEntityObject edmEntityObject = new EdmDeltaEntityObject(EntityType); + PatchItem(originalObj as EdmStructuredObject, edmEntityObject, apiHandler); + + edmEntityObject.TransientInstanceAnnotationContainer = changedObj.TransientInstanceAnnotationContainer; + edmEntityObject.PersistentInstanceAnnotationsContainer = changedObj.PersistentInstanceAnnotationsContainer; + + edmEntityObject.AddDataException( dataModificationExceptionType); + edmChangedObject = edmEntityObject; + break; + } + } + + return edmChangedObject; + } + + //This is for ODL to work to set id as empty, because if there are missing keys, id wouldnt be set and we need to set it as empty. + private static void ValidateForDeletedEntityId(IEdmStructuralProperty[] keys, EdmDeltaDeletedEntityObject edmDeletedObject) + { + bool hasNullKeys = false; + for (int i = 0; i < keys.Length; i++) + { + object value; + if (edmDeletedObject.TryGetPropertyValue(keys[i].Name, out value)) + { + hasNullKeys = true; + break; + } + } + + if (hasNullKeys) + { + edmDeletedObject.Id = string.Empty; + } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/EdmComplexCollectionObject.cs b/src/Microsoft.AspNet.OData.Shared/EdmComplexCollectionObject.cs index ab322a61eb..222a26e7f0 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmComplexCollectionObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmComplexCollectionObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.AspNet.OData.Shared/EdmComplexObject.cs b/src/Microsoft.AspNet.OData.Shared/EdmComplexObject.cs index a7ee0a6a66..f20034df69 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmComplexObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmComplexObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/EdmDeltaCollectionType.cs b/src/Microsoft.AspNet.OData.Shared/EdmDeltaCollectionType.cs index 638d083532..e7f8aeac05 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmDeltaCollectionType.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmDeltaCollectionType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; @@ -40,4 +44,4 @@ public IEdmTypeReference ElementType } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/EdmDeltaComplexObject.cs b/src/Microsoft.AspNet.OData.Shared/EdmDeltaComplexObject.cs index e5fd531c5f..12be9fcf21 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmDeltaComplexObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmDeltaComplexObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.OData.Edm; @@ -41,4 +45,4 @@ public EdmDeltaComplexObject(IEdmComplexType edmType, bool isNullable) { } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/EdmDeltaDeletedEntityObject.cs b/src/Microsoft.AspNet.OData.Shared/EdmDeltaDeletedEntityObject.cs index 25494d74ca..f548c7a44b 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmDeltaDeletedEntityObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmDeltaDeletedEntityObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; @@ -76,12 +80,11 @@ public DeltaDeletedEntryReason Reason } /// - public EdmDeltaEntityKind DeltaKind + public override EdmDeltaEntityKind DeltaKind { get - { - Contract.Assert(_edmType != null); - return _edmType.DeltaKind; + { + return EdmDeltaEntityKind.DeletedEntry; } } diff --git a/src/Microsoft.AspNet.OData.Shared/EdmDeltaDeletedLink.cs b/src/Microsoft.AspNet.OData.Shared/EdmDeltaDeletedLink.cs index ba64398e0d..bd12856bb3 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmDeltaDeletedLink.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmDeltaDeletedLink.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; @@ -88,13 +92,12 @@ public string Relationship } /// - public EdmDeltaEntityKind DeltaKind + public override EdmDeltaEntityKind DeltaKind { get - { - Contract.Assert(_edmType != null); - return _edmType.DeltaKind; + { + return EdmDeltaEntityKind.DeletedLinkEntry; } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/EdmDeltaEntityKind.cs b/src/Microsoft.AspNet.OData.Shared/EdmDeltaEntityKind.cs index 627d3cc422..22b88ee658 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmDeltaEntityKind.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmDeltaEntityKind.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData { @@ -33,4 +37,4 @@ public enum EdmDeltaEntityKind /// Unknown = 4 } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/EdmDeltaEntityObject.cs b/src/Microsoft.AspNet.OData.Shared/EdmDeltaEntityObject.cs index 8c0d0bdd40..dcd7603af9 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmDeltaEntityObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmDeltaEntityObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; @@ -47,12 +51,11 @@ public EdmDeltaEntityObject(IEdmEntityType entityType, bool isNullable) } /// - public EdmDeltaEntityKind DeltaKind + public override EdmDeltaEntityKind DeltaKind { get { - Contract.Assert(_edmType != null); - return _edmType.DeltaKind; + return EdmDeltaEntityKind.Entry; } } @@ -71,4 +74,4 @@ public IEdmNavigationSource NavigationSource } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/EdmDeltaLink.cs b/src/Microsoft.AspNet.OData.Shared/EdmDeltaLink.cs index 75d750c7e9..d79a158407 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmDeltaLink.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmDeltaLink.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; @@ -88,13 +92,12 @@ public string Relationship } /// - public EdmDeltaEntityKind DeltaKind + public override EdmDeltaEntityKind DeltaKind { get - { - Contract.Assert(_edmType != null); - return _edmType.DeltaKind; + { + return EdmDeltaEntityKind.LinkEntry; } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/EdmDeltaType.cs b/src/Microsoft.AspNet.OData.Shared/EdmDeltaType.cs index c787b3d3ae..56a567c3c4 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmDeltaType.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmDeltaType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/EdmEntityCollectionObject.cs b/src/Microsoft.AspNet.OData.Shared/EdmEntityCollectionObject.cs index 5370a91bbe..43ac44c869 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmEntityCollectionObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmEntityCollectionObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.AspNet.OData.Shared/EdmEntityObject.cs b/src/Microsoft.AspNet.OData.Shared/EdmEntityObject.cs index bd5cd4ccd0..fc092392cc 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmEntityObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmEntityObject.cs @@ -1,8 +1,17 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; +using System.Diagnostics.Contracts; +using System.Reflection; +using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; +using Org.OData.Core.V1; namespace Microsoft.AspNet.OData { @@ -10,7 +19,7 @@ namespace Microsoft.AspNet.OData /// Represents an with no backing CLR . /// [NonValidatingParameterBinding] - public class EdmEntityObject : EdmStructuredObject, IEdmEntityObject + public class EdmEntityObject : EdmStructuredObject, IEdmEntityObject, IEdmChangedObject { /// /// Initializes a new instance of the class. @@ -37,7 +46,52 @@ public EdmEntityObject(IEdmEntityTypeReference edmType) /// true if this object can be nullable; otherwise, false. public EdmEntityObject(IEdmEntityType edmType, bool isNullable) : base(edmType, isNullable) + { + PersistentInstanceAnnotationsContainer = new ODataInstanceAnnotationContainer(); + TransientInstanceAnnotationContainer = new ODataInstanceAnnotationContainer(); + } + + /// + /// Instance Annotation container to hold Transient Annotations + /// + internal IODataInstanceAnnotationContainer TransientInstanceAnnotationContainer { get; set; } + + /// + /// Instance Annotation container to hold Persistent Annotations + /// + public IODataInstanceAnnotationContainer PersistentInstanceAnnotationsContainer { get; set; } + + /// + /// Container to hold ODataId + /// + public ODataIdContainer ODataIdContainer { get; set; } + + /// + /// DeltaKind as Entry + /// + public virtual EdmDeltaEntityKind DeltaKind { get { return EdmDeltaEntityKind.Entry; } } + + /// + /// Method to Add Data Modification Exception + /// + public void AddDataException(DataModificationExceptionType dataModificationException) + { + Contract.Assert(TransientInstanceAnnotationContainer != null); + + TransientInstanceAnnotationContainer.AddResourceAnnotation(SRResources.DataModificationException, dataModificationException); + } + + /// + /// Method to Add Data Modification Exception + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate")] + public DataModificationExceptionType GetDataException() { + Contract.Assert(TransientInstanceAnnotationContainer != null); + + DataModificationExceptionType dataModificationExceptionType = TransientInstanceAnnotationContainer.GetResourceAnnotation(SRResources.DataModificationException) as DataModificationExceptionType; + + return dataModificationExceptionType; } } } diff --git a/src/Microsoft.AspNet.OData.Shared/EdmEnumObject.cs b/src/Microsoft.AspNet.OData.Shared/EdmEnumObject.cs index bb32316e32..df4a3a6cff 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmEnumObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmEnumObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; @@ -68,4 +72,4 @@ public IEdmTypeReference GetEdmType() return new EdmEnumTypeReference(_edmType as IEdmEnumType, IsNullable); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/EdmEnumObjectCollection.cs b/src/Microsoft.AspNet.OData.Shared/EdmEnumObjectCollection.cs index ff7f8e0d7c..cdab9f1a66 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmEnumObjectCollection.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmEnumObjectCollection.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.AspNet.OData.Shared/EdmModelExtensions.cs b/src/Microsoft.AspNet.OData.Shared/EdmModelExtensions.cs index 36e57f0678..02ef163879 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmModelExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmModelExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/EdmPatchMethodHandler.cs b/src/Microsoft.AspNet.OData.Shared/EdmPatchMethodHandler.cs new file mode 100644 index 0000000000..08273149fd --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/EdmPatchMethodHandler.cs @@ -0,0 +1,54 @@ +using Microsoft.OData.Edm; +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using System.Text; +using System.Threading.Tasks; + +namespace Microsoft.AspNet.OData +{ + + /// + /// Handler Class to handle users methods for create, delete and update. + /// This is the handler for data modification where there is no CLR type. + /// + public abstract class EdmODataAPIHandler + { + /// + /// TryCreate method to create a new object. + /// + /// Changed object which can be appied on creted object, optional + /// The created object (Typeless) + /// Any error message in case of an exception + /// The status of the TryCreate Method, statuses are + public abstract ODataAPIResponseStatus TryCreate(IEdmChangedObject changedObject, out IEdmStructuredObject createdObject, out string errorMessage); + + /// + /// TryGet method which tries to get the Origignal object based on a keyvalues. + /// + /// Key value pair for the entity keys + /// Object to return + /// Any error message in case of an exception + /// The status of the TryGet Method, statuses are + public abstract ODataAPIResponseStatus TryGet(IDictionary keyValues, out IEdmStructuredObject originalObject, out string errorMessage); + + /// + /// TryDelete Method which will delete the object based on keyvalue pairs. + /// + /// + /// + /// The status of the TryDelete Method, statuses are + public abstract ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage); + + /// + /// Get the API handler for the nested type + /// + /// Parent instance. + /// The name of the navigation property for the handler + /// Nested Patch Method handler for the navigation property + public abstract EdmODataAPIHandler GetNestedHandler(IEdmStructuredObject parent, string navigationPropertyName); + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/EdmStructuredObject.cs b/src/Microsoft.AspNet.OData.Shared/EdmStructuredObject.cs index b902532bf2..094d3a5ecf 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmStructuredObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmStructuredObject.cs @@ -1,10 +1,15 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; +using System.Reflection; using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Formatter; using Microsoft.OData.Edm; @@ -220,8 +225,15 @@ internal static object GetDefaultValue(IEdmTypeReference propertyType) if (propertyType.IsPrimitive() || (isCollection && propertyType.AsCollection().ElementType().IsPrimitive())) { + + bool hasDefaultConstructor = (!clrType.IsClass) || clrType.GetConstructors(BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Static). + Any(x => x.GetParameters().Count() == 0); + // primitive or primitive collection - return Activator.CreateInstance(clrType); + if (hasDefaultConstructor) + { + return Activator.CreateInstance(clrType); + } } else { diff --git a/src/Microsoft.AspNet.OData.Shared/EdmTypeExtensions.cs b/src/Microsoft.AspNet.OData.Shared/EdmTypeExtensions.cs index cd4cb7c314..489d68f49c 100644 --- a/src/Microsoft.AspNet.OData.Shared/EdmTypeExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/EdmTypeExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; @@ -22,7 +26,7 @@ public static bool IsDeltaFeed(this IEdmType type) { throw Error.ArgumentNull("type"); } - return (type.GetType() == typeof(EdmDeltaCollectionType)); + return (type.GetType() == typeof(EdmDeltaCollectionType)) || (type.GetType() == typeof(IDeltaSet)); } /// @@ -39,4 +43,4 @@ public static bool IsDeltaResource(this IEdmObject resource) return (resource is EdmDeltaEntityObject || resource is EdmDeltaComplexObject); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/EnableQueryAttribute.cs b/src/Microsoft.AspNet.OData.Shared/EnableQueryAttribute.cs index c2cc1b0e04..4611156f19 100644 --- a/src/Microsoft.AspNet.OData.Shared/EnableQueryAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/EnableQueryAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -611,7 +615,7 @@ private object ExecuteQuery( { IQueryable queryable = singleResultCollection as IQueryable; queryable = ApplyQuery(queryable, queryOptions); - return SingleOrDefault(queryable, actionDescriptor); + return QueryHelpers.SingleOrDefault(queryable, actionDescriptor); } } else @@ -676,44 +680,6 @@ internal static Type GetElementType( return elementClrType; } - /// - /// Get a single or default value from a collection. - /// - /// The response value as . - /// The action context, i.e. action and controller name. - /// - internal static object SingleOrDefault( - IQueryable queryable, - IWebApiActionDescriptor actionDescriptor) - { - var enumerator = queryable.GetEnumerator(); - try - { - var result = enumerator.MoveNext() ? enumerator.Current : null; - - if (enumerator.MoveNext()) - { - throw new InvalidOperationException(Error.Format( - SRResources.SingleResultHasMoreThanOneEntity, - actionDescriptor.ActionName, - actionDescriptor.ControllerName, - "SingleResult")); - } - - return result; - } - finally - { - // Ensure any active/open database objects that were created - // iterating over the IQueryable object are properly closed. - var disposable = enumerator as IDisposable; - if (disposable != null) - { - disposable.Dispose(); - } - } - } - /// /// Validate the select and expand options. /// @@ -816,4 +782,4 @@ private static bool ContainsAutoSelectExpandProperty( return false; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/ExpressionHelperMethods.cs b/src/Microsoft.AspNet.OData.Shared/ExpressionHelperMethods.cs index d65c9c71f0..df5c027968 100644 --- a/src/Microsoft.AspNet.OData.Shared/ExpressionHelperMethods.cs +++ b/src/Microsoft.AspNet.OData.Shared/ExpressionHelperMethods.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -111,6 +115,10 @@ internal class ExpressionHelperMethods private static MethodInfo _safeConvertToDecimalMethod = typeof(ExpressionHelperMethods).GetMethod("SafeConvertToDecimal"); +#if NETCORE // Not supported in NETFX + private static MethodInfo _queryableCreateSingleResultMethod = GenericMethodOf(_ => SingleResult.Create(default(IQueryable))); +#endif + public static MethodInfo EnumerableWhereGeneric { get { return _enumerableWhereMethod; } @@ -366,6 +374,13 @@ public static MethodInfo CreateQueryGeneric get { return _createQueryGenericMethod; } } +#if NETCORE // Not supported in NETFX + public static MethodInfo QueryableCreateSingleResult + { + get { return _queryableCreateSingleResultMethod; } + } +#endif + public static decimal? SafeConvertToDecimal(object value) { if (value == null || value == DBNull.Value) diff --git a/src/Microsoft.AspNet.OData.Shared/ExpressionHelpers.cs b/src/Microsoft.AspNet.OData.Shared/ExpressionHelpers.cs index 72f8998037..99752d3d3e 100644 --- a/src/Microsoft.AspNet.OData.Shared/ExpressionHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/ExpressionHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -229,6 +233,12 @@ public static IQueryable SelectMany(IQueryable query, LambdaExpression expressio return selectManyMethod.Invoke(null, new object[] { query, expression }) as IQueryable; } + public static IQueryable SelectMany(IQueryable query, LambdaExpression expression, Type sourceType, Type resultType) + { + MethodInfo selectManyMethod = ExpressionHelperMethods.QueryableSelectManyGeneric.MakeGenericMethod(sourceType, resultType); + return selectManyMethod.Invoke(null, new object[] { query, expression }) as IQueryable; + } + public static IQueryable Aggregate(IQueryable query, object init, LambdaExpression sumLambda, Type type, Type wrapperType) { Type returnType = sumLambda.Body.Type; @@ -276,5 +286,14 @@ public static LambdaExpression GetPropertyAccessLambda(Type type, string propert MemberExpression propertyAccess = Expression.Property(odataItParameter, propertyName); return Expression.Lambda(propertyAccess, odataItParameter); } + +#if NETCORE // Not supported in NETFX + + public static SingleResult CreateSingleResult(IQueryable query, Type type) + { + MethodInfo createSingleResultMethod = ExpressionHelperMethods.QueryableCreateSingleResult.MakeGenericMethod(type); + return createSingleResultMethod.Invoke(null, new[] { query }) as SingleResult; + } +#endif } } diff --git a/src/Microsoft.AspNet.OData.Shared/Extensions/ContainerBuilderExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Extensions/ContainerBuilderExtensions.cs index 6a6294fd2a..49053940c0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Extensions/ContainerBuilderExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Extensions/ContainerBuilderExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/FastPropertyAccessor.cs b/src/Microsoft.AspNet.OData.Shared/FastPropertyAccessor.cs index 01791e3508..33926c685f 100644 --- a/src/Microsoft.AspNet.OData.Shared/FastPropertyAccessor.cs +++ b/src/Microsoft.AspNet.OData.Shared/FastPropertyAccessor.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ClrTypeCache.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ClrTypeCache.cs index d70dce0751..b864c394b3 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ClrTypeCache.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ClrTypeCache.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Concurrent; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/DefaultODataETagHandler.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/DefaultODataETagHandler.cs index 9ffc54e96b..4a942faee5 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/DefaultODataETagHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/DefaultODataETagHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/CollectionDeserializationHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/CollectionDeserializationHelpers.cs index 59bbccfc02..285f8b1f11 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/CollectionDeserializationHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/CollectionDeserializationHelpers.cs @@ -1,9 +1,14 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Diagnostics.Contracts; using System.Linq; using System.Reflection; @@ -115,10 +120,26 @@ public static void Clear(this IEnumerable collection, string propertyName, Type clearMethod.Invoke(collection, _emptyObjectArray); } - public static bool TryCreateInstance(Type collectionType, IEdmCollectionTypeReference edmCollectionType, Type elementType, out IEnumerable instance) + public static bool TryCreateInstance(Type collectionType, IEdmCollectionTypeReference edmCollectionType, Type elementType, out IEnumerable instance, bool isDelta = false) { Contract.Assert(collectionType != null); + //For Delta Collection requests + if (isDelta) + { + if (elementType == typeof(IEdmEntityObject)) + { + instance = new EdmChangedObjectCollection(edmCollectionType.ElementType().AsEntity().Definition as IEdmEntityType); + } + else + { + Type type = typeof(DeltaSet<>).MakeGenericType(elementType); + instance = Activator.CreateInstance(type, edmCollectionType.ElementType().AsEntity().Key().Select(x => x.Name).ToList()) as ICollection; + } + + return true; + } + if (collectionType == typeof(EdmComplexObjectCollection)) { instance = new EdmComplexObjectCollection(edmCollectionType); diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/DefaultODataDeserializerProvider.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/DefaultODataDeserializerProvider.cs index cab4a6f838..b89f1355c9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/DefaultODataDeserializerProvider.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/DefaultODataDeserializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; @@ -88,8 +92,6 @@ internal ODataDeserializer GetODataDeserializerImpl(Type type, Func m return _rootContainer.GetRequiredService(); } - // Get the model. Using a Func to delay evaluation of the model - // until after the above checks have passed. IEdmModel model = modelFunction(); ClrTypeCache typeMappingCache = model.GetTypeMappingCache(); IEdmTypeReference edmType = typeMappingCache.GetEdmType(type, model); diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/DeserializationHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/DeserializationHelpers.cs index a50c4938fe..d0bb84036f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/DeserializationHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/DeserializationHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -82,18 +86,82 @@ internal static void ApplyProperty(ODataProperty property, IEdmStructuredTypeRef } } - internal static void ApplyInstanceAnnotations(object resource, IEdmStructuredTypeReference structuredType, ODataResource oDataResource, + internal static void ApplyInstanceAnnotations(object resource, IEdmStructuredTypeReference structuredType, ODataResourceBase oDataResource, ODataDeserializerProvider deserializerProvider, ODataDeserializerContext readContext) { - PropertyInfo propertyInfo = EdmLibHelpers.GetInstanceAnnotationsContainer(structuredType.StructuredDefinition(), readContext.Model); - if (propertyInfo == null) + //Apply instance annotations for both entityobject/changedobject/delta and normal resources + + IODataInstanceAnnotationContainer instanceAnnotationContainer = null; + IODataInstanceAnnotationContainer transientAnnotationContainer = null; + + EdmEntityObject edmObject = resource as EdmEntityObject; + + if (edmObject != null) + { + instanceAnnotationContainer = edmObject.PersistentInstanceAnnotationsContainer; + transientAnnotationContainer = edmObject.TransientInstanceAnnotationContainer; + } + else + { + PropertyInfo propertyInfo = EdmLibHelpers.GetInstanceAnnotationsContainer(structuredType.StructuredDefinition(), readContext.Model); + if (propertyInfo != null) + { + instanceAnnotationContainer = GetAnnotationContainer(propertyInfo, resource); + } + + IDeltaSetItem deltaItem = resource as IDeltaSetItem; + + if (deltaItem != null) + { + transientAnnotationContainer = deltaItem.TransientInstanceAnnotationContainer; + } + } + + if (instanceAnnotationContainer == null && transientAnnotationContainer == null) { return; } - IODataInstanceAnnotationContainer instanceAnnotationContainer = GetAnnotationContainer(propertyInfo, resource); + SetInstanceAnnotations(oDataResource, instanceAnnotationContainer, transientAnnotationContainer, deserializerProvider, readContext); + } + + internal static void ApplyODataIdContainer(object resource, IEdmStructuredTypeReference structuredType, ODataResourceBase oDataResource, + ODataDeserializerProvider deserializerProvider, ODataDeserializerContext readContext) + { + //Apply instance annotations for both entityobject/changedobject/delta and normal resources + + IODataInstanceAnnotationContainer instanceAnnotationContainer = null; + IODataInstanceAnnotationContainer transientAnnotationContainer = null; + + EdmEntityObject edmObject = resource as EdmEntityObject; + + if (edmObject != null) + { + instanceAnnotationContainer = edmObject.PersistentInstanceAnnotationsContainer; + transientAnnotationContainer = edmObject.TransientInstanceAnnotationContainer; + } + else + { + PropertyInfo propertyInfo = EdmLibHelpers.GetInstanceAnnotationsContainer(structuredType.StructuredDefinition(), readContext.Model); + if (propertyInfo != null) + { + instanceAnnotationContainer = GetAnnotationContainer(propertyInfo, resource); + } + + IDeltaSetItem deltaItem = resource as IDeltaSetItem; + + if (deltaItem != null) + { + transientAnnotationContainer = deltaItem.TransientInstanceAnnotationContainer; + } + } + + if (instanceAnnotationContainer == null && transientAnnotationContainer == null) + { + return; + } - SetInstanceAnnotations(oDataResource, instanceAnnotationContainer, deserializerProvider, readContext); + SetInstanceAnnotations(oDataResource, instanceAnnotationContainer, transientAnnotationContainer, deserializerProvider, readContext); } internal static void SetDynamicProperty(object resource, IEdmStructuredTypeReference resourceType, @@ -135,15 +203,15 @@ internal static void SetDeclaredProperty(object resource, EdmTypeKind propertyKi } } - internal static void SetCollectionProperty(object resource, IEdmProperty edmProperty, object value, string propertyName) + internal static void SetCollectionProperty(object resource, IEdmProperty edmProperty, object value, string propertyName, bool isDelta = false) { Contract.Assert(edmProperty != null); - SetCollectionProperty(resource, propertyName, edmProperty.Type.AsCollection(), value, clearCollection: false); + SetCollectionProperty(resource, propertyName, edmProperty.Type.AsCollection(), value, clearCollection: false, isDelta); } internal static void SetCollectionProperty(object resource, string propertyName, - IEdmCollectionTypeReference edmPropertyType, object value, bool clearCollection) + IEdmCollectionTypeReference edmPropertyType, object value, bool clearCollection, bool isDelta = false) { if (value != null) { @@ -163,7 +231,7 @@ internal static void SetCollectionProperty(object resource, string propertyName, IEnumerable newCollection; if (CanSetProperty(resource, propertyName) && - CollectionDeserializationHelpers.TryCreateInstance(propertyType, edmPropertyType, elementType, out newCollection)) + CollectionDeserializationHelpers.TryCreateInstance(propertyType, edmPropertyType, elementType, out newCollection, isDelta)) { // settable collections collection.AddToCollection(newCollection, elementType, resourceType, propertyName, propertyType); @@ -274,14 +342,21 @@ internal static void SetDynamicProperty(object resource, string propertyName, ob } } - internal static void SetInstanceAnnotations(ODataResource oDataResource, IODataInstanceAnnotationContainer instanceAnnotationContainer, - ODataDeserializerProvider deserializerProvider, ODataDeserializerContext readContext) + internal static void SetInstanceAnnotations(ODataResourceBase oDataResource, IODataInstanceAnnotationContainer instanceAnnotationContainer, + IODataInstanceAnnotationContainer transientAnnotationContainer, ODataDeserializerProvider deserializerProvider, ODataDeserializerContext readContext) { if(oDataResource.InstanceAnnotations != null) { foreach (ODataInstanceAnnotation annotation in oDataResource.InstanceAnnotations) { - AddInstanceAnnotationToContainer(instanceAnnotationContainer, deserializerProvider, readContext, annotation,string.Empty); + if (!TransientAnnotations.TransientAnnotationTerms.Contains(annotation.Name)) + { + AddInstanceAnnotationToContainer(instanceAnnotationContainer, deserializerProvider, readContext, annotation, string.Empty); + } + else + { + AddInstanceAnnotationToContainer(transientAnnotationContainer, deserializerProvider, readContext, annotation, string.Empty); + } } } @@ -313,11 +388,12 @@ private static void AddInstanceAnnotationToContainer(IODataInstanceAnnotationCon instanceAnnotationContainer.AddPropertyAnnotation(propertyName,annotation.Name, annotationValue); } } - + public static IODataInstanceAnnotationContainer GetAnnotationContainer(PropertyInfo propertyInfo, object resource) - { + { + object value; IDelta delta = resource as IDelta; - object value; + if (delta != null) { delta.TryGetPropertyValue(propertyInfo.Name, out value); @@ -325,7 +401,7 @@ public static IODataInstanceAnnotationContainer GetAnnotationContainer(PropertyI else { value = propertyInfo.GetValue(resource); - } + } IODataInstanceAnnotationContainer instanceAnnotationContainer = value as IODataInstanceAnnotationContainer; @@ -341,8 +417,8 @@ public static IODataInstanceAnnotationContainer GetAnnotationContainer(PropertyI { instanceAnnotationContainer = Activator.CreateInstance(propertyInfo.PropertyType) as IODataInstanceAnnotationContainer; } - - if(delta != null) + + if (delta != null) { delta.TrySetPropertyValue(propertyInfo.Name, instanceAnnotationContainer); } diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/EnumDeserializationHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/EnumDeserializationHelpers.cs index 88eccdbdcd..9c3fda6ba9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/EnumDeserializationHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/EnumDeserializationHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; @@ -44,4 +48,4 @@ public static object ConvertEnumValue(object value, Type type) return Enum.Parse(enumType, enumValue.Value); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataActionPayloadDeserializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataActionPayloadDeserializer.cs index 870a178e16..737449aead 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataActionPayloadDeserializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataActionPayloadDeserializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -310,4 +314,4 @@ private static void ProcessResourceSet(object feed, IEdmCollectionTypeReference } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataCollectionDeserializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataCollectionDeserializer.cs index 16bf33758f..3de3fabe08 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataCollectionDeserializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataCollectionDeserializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeltaResourceSetWrapper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeltaResourceSetWrapper.cs new file mode 100644 index 0000000000..daccf58009 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeltaResourceSetWrapper.cs @@ -0,0 +1,26 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.OData; + +namespace Microsoft.AspNet.OData.Formatter.Deserialization +{ + /// + /// Encapsulates an and the 's that are part of it. + /// + public sealed class ODataDeltaResourceSetWrapper : ODataResourceSetWrapperBase + { + /// + /// Initializes a new instance of . + /// + /// The wrapped item. + public ODataDeltaResourceSetWrapper(ODataDeltaResourceSet item) + : base(item) + { + + } + + internal override ResourceSetType ResourceSetType => ResourceSetType.DeltaResourceSet; + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializer.cs index fe90feb2c2..a167a088d7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializerContext.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializerContext.cs index 494bfdfe6c..0dabf8e822 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializerContext.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Interfaces; @@ -14,7 +18,11 @@ namespace Microsoft.AspNet.OData.Formatter.Deserialization public partial class ODataDeserializerContext { private bool? _isDeltaOfT; + private bool? _isDeletedDeltaOfT; private bool? _isUntyped; + private bool? _isChangedObjectCollection; + private bool? _isDeltaEntity; + private bool? _isDeltaDeletedEntity; /// /// Gets or sets the type of the top-level object the request needs to be deserialized into. @@ -58,20 +66,75 @@ internal bool IsDeltaOfT { if (!_isDeltaOfT.HasValue) { - _isDeltaOfT = ResourceType != null && TypeHelper.IsGenericType(ResourceType) && ResourceType.GetGenericTypeDefinition() == typeof(Delta<>); + _isDeltaOfT = ResourceType != null && TypeHelper.IsGenericType(ResourceType) && (ResourceType.GetGenericTypeDefinition() == typeof(Delta<>) || + ResourceType.GetGenericTypeDefinition() == typeof(DeltaDeletedEntityObject<>)); } return _isDeltaOfT.Value; } } + internal bool IsDeletedDeltaOfT + { + get + { + if (!_isDeletedDeltaOfT.HasValue) + { + _isDeletedDeltaOfT = ResourceType != null && TypeHelper.IsGenericType(ResourceType) && (ResourceType.GetGenericTypeDefinition() == typeof(DeltaDeletedEntityObject<>) || + ResourceType.GetGenericTypeDefinition() == typeof(DeltaDeletedEntityObject<>)); + } + + return _isDeletedDeltaOfT.Value; + } + } + + internal bool IsDeltaEntity + { + get + { + if (!_isDeltaEntity.HasValue) + { + _isDeltaEntity = ResourceType != null && (ResourceType == typeof(EdmDeltaEntityObject) || ResourceType == typeof(EdmDeltaDeletedEntityObject)); + } + + return _isDeltaEntity.Value; + } + } + + internal bool IsDeltaDeletedEntity + { + get + { + if (!_isDeltaDeletedEntity.HasValue) + { + _isDeltaDeletedEntity = ResourceType != null && ResourceType == typeof(EdmDeltaDeletedEntityObject); + } + + return _isDeltaDeletedEntity.Value; + } + } + + internal bool IsChangedObjectCollection + { + get + { + if (!_isChangedObjectCollection.HasValue) + { + _isChangedObjectCollection = ResourceType != null && (ResourceType == typeof(EdmChangedObjectCollection) || (TypeHelper.IsGenericType(ResourceType) && + ResourceType.GetGenericTypeDefinition() == typeof(DeltaSet<>) )); + } + + return _isChangedObjectCollection.Value; + } + } + internal bool IsUntyped { get { if (!_isUntyped.HasValue) { - _isUntyped = TypeHelper.IsTypeAssignableFrom(typeof(IEdmObject), ResourceType) || + _isUntyped = IsChangedObjectCollection ? !TypeHelper.IsGenericType(ResourceType) : (TypeHelper.IsTypeAssignableFrom(typeof(IEdmObject), ResourceType) && !IsDeltaOfT) || typeof(ODataUntypedActionParameters) == ResourceType; } diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializerProvider.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializerProvider.cs index 1a7e17a2b4..9e7c3ec021 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializerProvider.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataDeserializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEdmTypeDeserializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEdmTypeDeserializer.cs index 14a4c6f4bc..9a2d3cac9f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEdmTypeDeserializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEdmTypeDeserializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEntityReferenceLinkBase.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEntityReferenceLinkBase.cs index eff07d138a..ebbbf435f9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEntityReferenceLinkBase.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEntityReferenceLinkBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData; @@ -17,17 +21,13 @@ public class ODataEntityReferenceLinkBase : ODataItemBase public ODataEntityReferenceLinkBase(ODataEntityReferenceLink item) : base(item) { + EntityReferenceLink = item; } /// /// Gets the wrapped . /// - public ODataEntityReferenceLink EntityReferenceLink - { - get - { - return Item as ODataEntityReferenceLink; - } - } + public ODataEntityReferenceLink EntityReferenceLink { get; } + } } diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEntityReferenceLinkDeserializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEntityReferenceLinkDeserializer.cs index ecf6fb3446..0b92e4b23a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEntityReferenceLinkDeserializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEntityReferenceLinkDeserializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEnumDeserializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEnumDeserializer.cs index 061a0ae5a1..fb7a6b13ee 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEnumDeserializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataEnumDeserializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataItemBase.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataItemBase.cs index 8860176bbe..25f6805f67 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataItemBase.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataItemBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataNestedResourceInfoWrapper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataNestedResourceInfoWrapper.cs index 5dc286af5a..1793290957 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataNestedResourceInfoWrapper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataNestedResourceInfoWrapper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.OData; @@ -40,5 +44,6 @@ public ODataNestedResourceInfo NestedResourceInfo /// Gets the nested items that are part of this nested resource info. /// public IList NestedItems { get; private set; } + } } diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataPrimitiveDeserializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataPrimitiveDeserializer.cs index cddfbb4ea1..af3e8d78f0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataPrimitiveDeserializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataPrimitiveDeserializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataReaderExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataReaderExtensions.cs index e86b4bcf3a..a7d1d069b7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataReaderExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataReaderExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.Contracts; @@ -85,30 +89,31 @@ private static void ReadCollectionItem(ODataReader reader, Stack } else { - ODataItemBase parentItem = itemsStack.Peek(); - ODataResourceSetWrapper parentResourceSet = parentItem as ODataResourceSetWrapper; - if (parentResourceSet != null) - { - parentResourceSet.Resources.Add(resourceWrapper); - } - else - { - ODataNestedResourceInfoWrapper parentNestedResource = (ODataNestedResourceInfoWrapper)parentItem; - Contract.Assert(parentNestedResource.NestedResourceInfo.IsCollection == false, "Only singleton nested properties can contain resource as their child."); - Contract.Assert(parentNestedResource.NestedItems.Count == 0, "Each nested property can contain only one resource as its direct child."); - parentNestedResource.NestedItems.Add(resourceWrapper); - } + AddResourceToParent(itemsStack, resourceWrapper); } itemsStack.Push(resourceWrapper); break; case ODataReaderState.ResourceEnd: + case ODataReaderState.DeletedResourceEnd: Contract.Assert( itemsStack.Count > 0 && (reader.Item == null || itemsStack.Peek().Item == reader.Item), "The resource which is ending should be on the top of the items stack."); itemsStack.Pop(); break; + case ODataReaderState.DeletedResourceStart: + ODataDeletedResource deletedResource = (ODataDeletedResource)reader.Item; + Contract.Assert(deletedResource != null, "Deleted resource should not be null"); + + ODataResourceWrapper deletedResourceWrapper = new ODataResourceWrapper(deletedResource); + + Contract.Assert(itemsStack.Count != 0, "Deleted Resource should not be top level item"); + + AddResourceToParent(itemsStack, deletedResourceWrapper); + + itemsStack.Push(deletedResourceWrapper); + break; case ODataReaderState.NestedResourceInfoStart: ODataNestedResourceInfo nestedResourceInfo = (ODataNestedResourceInfo)reader.Item; @@ -135,12 +140,10 @@ private static void ReadCollectionItem(ODataReader reader, Stack Contract.Assert(resourceSet != null, "ResourceSet should never be null."); ODataResourceSetWrapper resourceSetWrapper = new ODataResourceSetWrapper(resourceSet); + if (itemsStack.Count > 0) { - ODataNestedResourceInfoWrapper parentNestedResourceInfo = (ODataNestedResourceInfoWrapper)itemsStack.Peek(); - Contract.Assert(parentNestedResourceInfo != null, "this has to be an inner resource set. inner resource sets always have a nested resource info."); - Contract.Assert(parentNestedResourceInfo.NestedResourceInfo.IsCollection == true, "Only collection nested properties can contain resource set as their child."); - parentNestedResourceInfo.NestedItems.Add(resourceSetWrapper); + AddNestedResourceInfo(itemsStack, resourceSetWrapper); } else { @@ -151,6 +154,7 @@ private static void ReadCollectionItem(ODataReader reader, Stack break; case ODataReaderState.ResourceSetEnd: + case ODataReaderState.DeltaResourceSetEnd: Contract.Assert(itemsStack.Count > 0 && itemsStack.Peek().Item == reader.Item, "The resource set which is ending should be on the top of the items stack."); itemsStack.Pop(); break; @@ -167,11 +171,58 @@ private static void ReadCollectionItem(ODataReader reader, Stack } break; + case ODataReaderState.DeltaResourceSetStart: + ODataDeltaResourceSet deltaResourceSet = (ODataDeltaResourceSet)reader.Item; + Contract.Assert(deltaResourceSet != null, "ResourceSet should never be null."); + + ODataDeltaResourceSetWrapper deltaResourceSetWrapper = new ODataDeltaResourceSetWrapper(deltaResourceSet); + + if (itemsStack.Count > 0) + { + AddNestedResourceInfo(itemsStack, deltaResourceSetWrapper); + } + else + { + topLevelItem = deltaResourceSetWrapper; + } + + itemsStack.Push(deltaResourceSetWrapper); + break; + case ODataReaderState.DeltaLink: + case ODataReaderState.DeltaDeletedLink: + + //Throw error if Delta Link appears + throw Error.NotSupported(SRResources.DeltaLinkNotSupported); + default: Contract.Assert(false, "We should never get here, it means the ODataReader reported a wrong state."); break; } } + + + private static void AddNestedResourceInfo(Stack itemsStack, ODataResourceSetWrapperBase resourceSetWrapper) + { + ODataNestedResourceInfoWrapper parentNestedResourceInfo = (ODataNestedResourceInfoWrapper)itemsStack.Peek(); + Contract.Assert(parentNestedResourceInfo != null, "this has to be an inner resource set. inner resource sets always have a nested resource info."); + Contract.Assert(parentNestedResourceInfo.NestedResourceInfo.IsCollection == true, "Only collection nested properties can contain resource set as their child."); + parentNestedResourceInfo.NestedItems.Add(resourceSetWrapper); + } + + private static void AddResourceToParent(Stack itemsStack, ODataResourceWrapper resourceWrapper) + { + ODataItemBase parentItem = itemsStack.Peek(); + ODataResourceSetWrapperBase parentResourceSet = parentItem as ODataResourceSetWrapperBase; + if (parentResourceSet != null) + { + parentResourceSet.Resources.Add(resourceWrapper); + } + else + { + ODataNestedResourceInfoWrapper parentNestedResource = (ODataNestedResourceInfoWrapper)parentItem; + parentNestedResource.NestedItems.Add(resourceWrapper); + } + } } } diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceDeserializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceDeserializer.cs index 290b21771b..ab8ca077b7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceDeserializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceDeserializer.cs @@ -1,9 +1,14 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Diagnostics.Contracts; using System.Linq; using System.Reflection; @@ -11,15 +16,19 @@ using System.Runtime.Serialization; using System.Threading.Tasks; using Microsoft.AspNet.OData.Common; -using Microsoft.AspNet.OData.Formatter.Serialization; +using Microsoft.AspNet.OData.Interfaces; +using Microsoft.AspNet.OData.Routing; using Microsoft.OData; using Microsoft.OData.Edm; +using Microsoft.OData.UriParser; +using ODataPath = Microsoft.AspNet.OData.Routing.ODataPath; namespace Microsoft.AspNet.OData.Formatter.Deserialization { /// /// Represents an for reading OData resource payloads. /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] public class ODataResourceDeserializer : ODataEdmTypeDeserializer { /// @@ -96,6 +105,7 @@ public sealed override object ReadInline(object item, IEdmTypeReference edmType, // Recursion guard to avoid stack overflows RuntimeHelpers.EnsureSufficientExecutionStack(); + resourceWrapper = UpdateResourceWrapper(resourceWrapper, readContext); return ReadResource(resourceWrapper, edmType.AsStructured(), readContext); } @@ -119,8 +129,9 @@ public virtual object ReadResource(ODataResourceWrapper resourceWrapper, IEdmStr { throw Error.ArgumentNull("readContext"); } + - if (!String.IsNullOrEmpty(resourceWrapper.Resource.TypeName) && structuredType.FullName() != resourceWrapper.Resource.TypeName) + if (!String.IsNullOrEmpty(resourceWrapper.ResourceBase.TypeName) && structuredType.FullName() != resourceWrapper.ResourceBase.TypeName) { // received a derived type in a base type deserializer. delegate it to the appropriate derived type deserializer. IEdmModel model = readContext.Model; @@ -130,20 +141,21 @@ public virtual object ReadResource(ODataResourceWrapper resourceWrapper, IEdmStr throw Error.Argument("readContext", SRResources.ModelMissingFromReadContext); } - IEdmStructuredType actualType = model.FindType(resourceWrapper.Resource.TypeName) as IEdmStructuredType; + IEdmStructuredType actualType = model.FindType(resourceWrapper.ResourceBase.TypeName) as IEdmStructuredType; if (actualType == null) { - throw new ODataException(Error.Format(SRResources.ResourceTypeNotInModel, resourceWrapper.Resource.TypeName)); + throw new ODataException(Error.Format(SRResources.ResourceTypeNotInModel, resourceWrapper.ResourceBase.TypeName)); } if (actualType.IsAbstract) { - string message = Error.Format(SRResources.CannotInstantiateAbstractResourceType, resourceWrapper.Resource.TypeName); + string message = Error.Format(SRResources.CannotInstantiateAbstractResourceType, resourceWrapper.ResourceBase.TypeName); throw new ODataException(message); } IEdmTypeReference actualStructuredType; IEdmEntityType actualEntityType = actualType as IEdmEntityType; + if (actualEntityType != null) { actualStructuredType = new EdmEntityTypeReference(actualEntityType, isNullable: false); @@ -174,10 +186,19 @@ public virtual object ReadResource(ODataResourceWrapper resourceWrapper, IEdmStr { object resource = CreateResourceInstance(structuredType, readContext); ApplyResourceProperties(resource, resourceWrapper, structuredType, readContext); + + ODataDeletedResource deletedResource = resourceWrapper.ResourceBase as ODataDeletedResource; + + if (deletedResource != null) + { + AppendDeletedProperties(resource, deletedResource, readContext.IsUntyped); + } + return resource; } } + /// /// Creates a new instance of the backing CLR object for the given resource type. /// @@ -206,6 +227,11 @@ public virtual object CreateResourceInstance(IEdmStructuredTypeReference structu { if (structuredType.IsEntity()) { + if (readContext.IsDeltaDeletedEntity) + { + return new EdmDeltaDeletedEntityObject(structuredType.AsEntity()); + } + return new EdmEntityObject(structuredType.AsEntity()); } @@ -222,8 +248,11 @@ public virtual object CreateResourceInstance(IEdmStructuredTypeReference structu if (readContext.IsDeltaOfT) { - IEnumerable structuralProperties = structuredType.StructuralProperties() + IEnumerable structuralProperties = structuredType.StructuredDefinition().Properties() .Select(edmProperty => EdmLibHelpers.GetClrPropertyName(edmProperty, model)); + + PropertyInfo instanceAnnotationProperty = EdmLibHelpers.GetInstanceAnnotationsContainer( + structuredType.StructuredDefinition(), model); if (structuredType.IsOpen()) { @@ -231,11 +260,11 @@ public virtual object CreateResourceInstance(IEdmStructuredTypeReference structu structuredType.StructuredDefinition(), model); return Activator.CreateInstance(readContext.ResourceType, clrType, structuralProperties, - dynamicDictionaryPropertyInfo); + dynamicDictionaryPropertyInfo, instanceAnnotationProperty); } else { - return Activator.CreateInstance(readContext.ResourceType, clrType, structuralProperties); + return Activator.CreateInstance(readContext.ResourceType, clrType, structuralProperties, null, instanceAnnotationProperty); } } else @@ -245,6 +274,20 @@ public virtual object CreateResourceInstance(IEdmStructuredTypeReference structu } } + private static void AppendDeletedProperties(dynamic resource, ODataDeletedResource deletedResource, bool isUntyped) + { + if (isUntyped) + { + resource.Id = deletedResource.Id.ToString(); + } + else + { + resource.Id = deletedResource.Id; + } + + resource.Reason = deletedResource.Reason.Value; + } + /// /// Deserializes the nested properties from into . /// @@ -297,7 +340,39 @@ public virtual void ApplyNestedProperty(object resource, ODataNestedResourceInfo } } - foreach (ODataItemBase childItem in resourceInfoWrapper.NestedItems) + IList nestedItems; + ODataEntityReferenceLinkBase[] referenceLinks = resourceInfoWrapper.NestedItems.OfType().ToArray(); + if (referenceLinks.Length > 0) + { + // Be noted: + // 1) OData v4.0, it's "Orders@odata.bind", and we get "ODataEntityReferenceLinkWrapper"(s) for that. + // 2) OData v4.01, it's {"odata.id" ...}, and we get "ODataResource"(s) for that. + // So, in OData v4, if it's a single, NestedItems contains one ODataEntityReferenceLinkWrapper, + // if it's a collection, NestedItems contains multiple ODataEntityReferenceLinkWrapper(s) + // We can use the following code to adjust the `ODataEntityReferenceLinkWrapper` to `ODataResourceWrapper`. + // In OData v4.01, we will not be here. + // Only supports declared property + Contract.Assert(edmProperty != null); + + nestedItems = new List(); + if (edmProperty.Type.IsCollection()) + { + IEdmCollectionTypeReference edmCollectionTypeReference = edmProperty.Type.AsCollection(); + ODataResourceSetWrapper resourceSetWrapper = CreateResourceSetWrapper(edmCollectionTypeReference, referenceLinks, readContext); + nestedItems.Add(resourceSetWrapper); + } + else + { + ODataResourceWrapper resourceWrapper = CreateResourceWrapper(edmProperty.Type, referenceLinks[0], readContext); + nestedItems.Add(resourceWrapper); + } + } + else + { + nestedItems = resourceInfoWrapper.NestedItems; + } + + foreach (ODataItemBase childItem in nestedItems) { // it maybe null. if (childItem == null) @@ -313,15 +388,8 @@ public virtual void ApplyNestedProperty(object resource, ODataNestedResourceInfo ApplyResourceInNestedProperty(edmProperty, resource, null, readContext); } } - - ODataEntityReferenceLinkBase entityReferenceLink = childItem as ODataEntityReferenceLinkBase; - if (entityReferenceLink != null) - { - // ignore entity reference links. - continue; - } - - ODataResourceSetWrapper resourceSetWrapper = childItem as ODataResourceSetWrapper; + + ODataResourceSetWrapperBase resourceSetWrapper = childItem as ODataResourceSetWrapperBase; if (resourceSetWrapper != null) { if (edmProperty == null) @@ -354,6 +422,188 @@ public virtual void ApplyNestedProperty(object resource, ODataNestedResourceInfo } } + + private ODataResourceSetWrapper CreateResourceSetWrapper(IEdmCollectionTypeReference edmPropertyType, + IList refLinks, ODataDeserializerContext readContext) + { + ODataResourceSet resourceSet = new ODataResourceSet + { + TypeName = edmPropertyType.FullName(), + }; + + IEdmTypeReference elementType = edmPropertyType.ElementType(); + ODataResourceSetWrapper resourceSetWrapper = new ODataResourceSetWrapper(resourceSet); + foreach (ODataEntityReferenceLinkBase refLinkWrapper in refLinks) + { + ODataResourceWrapper resourceWrapper = CreateResourceWrapper(elementType, refLinkWrapper, readContext); + resourceSetWrapper.Resources.Add(resourceWrapper); + } + + return resourceSetWrapper; + } + + private ODataResourceWrapper CreateResourceWrapper(IEdmTypeReference edmPropertyType, ODataEntityReferenceLinkBase refLink, ODataDeserializerContext readContext) + { + Contract.Assert(readContext != null); + + ODataResource resource = new ODataResource + { + TypeName = edmPropertyType.FullName(), + }; + + resource.Properties = CreateKeyProperties(refLink.EntityReferenceLink.Url, readContext); + + if (refLink.EntityReferenceLink.InstanceAnnotations != null) + { + foreach (ODataInstanceAnnotation instanceAnnotation in refLink.EntityReferenceLink.InstanceAnnotations) + { + resource.InstanceAnnotations.Add(instanceAnnotation); + }; + } + + return new ODataResourceWrapper(resource); + } + + /// + /// Update the resource wrapper if it has the "Id" value. + /// + /// The resource wrapper. + /// The read context. + /// The resource wrapper. + private ODataResourceWrapper UpdateResourceWrapper(ODataResourceWrapper resourceWrapper, ODataDeserializerContext readContext) + { + Contract.Assert(readContext != null); + + if (resourceWrapper?.ResourceBase?.Id == null) + { + return resourceWrapper; + } + + IEnumerable keys = CreateKeyProperties(resourceWrapper.ResourceBase.Id, readContext); + if (keys == null) + { + return resourceWrapper; + } + + if (resourceWrapper.ResourceBase.Properties == null) + { + resourceWrapper.ResourceBase.Properties = keys; + } + else + { + IDictionary newPropertiesDic = resourceWrapper.ResourceBase.Properties.ToDictionary(p => p.Name, p => p); + foreach (ODataProperty key in keys) + { + if (!newPropertiesDic.ContainsKey(key.Name)) + { + newPropertiesDic[key.Name] = key; + } + } + + resourceWrapper.ResourceBase.Properties = newPropertiesDic.Values; + } + + return resourceWrapper; + } + + /// + /// Do uri parsing to get the key values. + /// + /// The key Id. + /// The reader context. + /// The key properties. + private static IList CreateKeyProperties(Uri id, ODataDeserializerContext readContext) + { + Contract.Assert(id != null); + Contract.Assert(readContext != null); + IList properties = new List(); + if (readContext.Request == null) + { + return properties; + } + + ODataPath odataPath = GetODataPath(id.OriginalString, readContext); + if (odataPath?.Segments != null) + { + KeySegment keySegment = odataPath.Segments.OfType().LastOrDefault(); + + if (keySegment != null) + { + foreach (KeyValuePair key in keySegment.Keys) + { + properties.Add(new ODataProperty + { + Name = key.Key, + Value = key.Value + }); + } + } + } + + return properties; + } + + private static ODataPath GetODataPath(string id, ODataDeserializerContext readContext) + { + try + { + IODataPathHandler pathHandler = readContext.InternalRequest.PathHandler; + IWebApiRequestMessage internalRequest = readContext.InternalRequest; + IWebApiUrlHelper urlHelper = readContext.InternalUrlHelper; + + string serviceRoot = urlHelper.CreateODataLink( + internalRequest.Context.RouteName, + internalRequest.PathHandler, + new List()); + ODataPath odataPath = pathHandler.Parse(serviceRoot, id, internalRequest.RequestContainer); + + + return odataPath; + } + catch (Exception) + { + return null; + } + } + + private static void ApplyODataIDContainer(object resource, ODataResourceWrapper resourceWrapper, + ODataDeserializerContext readContext) + { + //Setting Odataid , for POCO classes, as a property in the POCO object itself(if user has OdataIDContainer property), + //for Delta and EdmEntity object setting as an added property ODataIdcontianer in those classes + if (resourceWrapper.ResourceBase?.Id != null) + { + string odataId = resourceWrapper.ResourceBase.Id.OriginalString; + + ODataPath odataPath = GetODataPath(odataId, readContext); + + if (odataPath != null) + { + ODataIdContainer container = new ODataIdContainer(); + + NavigationPath navigationPath = new NavigationPath(odataId, odataPath.Segments); + container.ODataIdNavigationPath = navigationPath; + + if (resource is EdmEntityObject edmObject) + { + edmObject.ODataIdContainer = container; + } + else if (resource is IDeltaSetItem deltasetItem) + { + deltasetItem.ODataIdContainer = container; + } + else + { + PropertyInfo containerPropertyInfo = EdmLibHelpers.GetClrType(odataPath.EdmType, readContext.Model).GetProperties().Where(x => x.PropertyType == typeof(ODataIdContainer)).FirstOrDefault(); + if (containerPropertyInfo != null) + { + containerPropertyInfo.SetValue(resource, container); + } + } + } + } + } + /// /// Deserializes the structural properties from into . /// @@ -369,7 +619,7 @@ public virtual void ApplyStructuralProperties(object resource, ODataResourceWrap throw Error.ArgumentNull("resourceWrapper"); } - foreach (ODataProperty property in resourceWrapper.Resource.Properties) + foreach (ODataProperty property in resourceWrapper.ResourceBase.Properties) { ApplyStructuralProperty(resource, property, structuredType, readContext); } @@ -390,7 +640,7 @@ public virtual void ApplyInstanceAnnotations(object resource, ODataResourceWrapp throw Error.ArgumentNull("resourceWrapper"); } - DeserializationHelpers.ApplyInstanceAnnotations(resource, structuredType, resourceWrapper.Resource,DeserializerProvider, readContext); + DeserializationHelpers.ApplyInstanceAnnotations(resource, structuredType, resourceWrapper.ResourceBase,DeserializerProvider, readContext); } /// @@ -418,10 +668,12 @@ public virtual void ApplyStructuralProperty(object resource, ODataProperty struc private void ApplyResourceProperties(object resource, ODataResourceWrapper resourceWrapper, IEdmStructuredTypeReference structuredType, ODataDeserializerContext readContext) + { ApplyStructuralProperties(resource, resourceWrapper, structuredType, readContext); ApplyNestedProperties(resource, resourceWrapper, structuredType, readContext); ApplyInstanceAnnotations(resource, resourceWrapper, structuredType, readContext); + ApplyODataIDContainer(resource, resourceWrapper, readContext); } private void ApplyResourceInNestedProperty(IEdmProperty nestedProperty, object resource, @@ -431,19 +683,8 @@ private void ApplyResourceInNestedProperty(IEdmProperty nestedProperty, object r Contract.Assert(resource != null); Contract.Assert(readContext != null); - if (readContext.IsDeltaOfT) - { - IEdmNavigationProperty navigationProperty = nestedProperty as IEdmNavigationProperty; - if (navigationProperty != null) - { - string message = Error.Format(SRResources.CannotPatchNavigationProperties, navigationProperty.Name, - navigationProperty.DeclaringEntityType().FullName()); - throw new ODataException(message); - } - } - object value = ReadNestedResourceInline(resourceWrapper, nestedProperty.Type, readContext); - + // First resolve Data member alias or annotation, then set the regular // or delta resource accordingly. string propertyName = EdmLibHelpers.GetClrPropertyName(nestedProperty, readContext.Model); @@ -460,7 +701,7 @@ private void ApplyDynamicResourceInNestedProperty(string propertyName, object re object value = null; if (resourceWrapper != null) { - IEdmSchemaType elementType = readContext.Model.FindDeclaredType(resourceWrapper.Resource.TypeName); + IEdmSchemaType elementType = readContext.Model.FindDeclaredType(resourceWrapper.ResourceBase.TypeName); IEdmTypeReference edmTypeReference = elementType.ToEdmTypeReference(true); value = ReadNestedResourceInline(resourceWrapper, edmTypeReference, readContext); @@ -492,14 +733,14 @@ private object ReadNestedResourceInline(ODataResourceWrapper resourceWrapper, IE { Path = readContext.Path, Model = readContext.Model, - Request = readContext.Request, + Request = readContext.Request }; Type clrType = null; if (readContext.IsUntyped) { clrType = structuredType.IsEntity() - ? typeof(EdmEntityObject) + ? (readContext.IsDeltaEntity ? (readContext.IsDeltaDeletedEntity? typeof(EdmDeltaDeletedEntityObject) : typeof(EdmDeltaEntityObject) ) : typeof(EdmEntityObject)) : typeof(EdmComplexObject); } else @@ -518,45 +759,33 @@ private object ReadNestedResourceInline(ODataResourceWrapper resourceWrapper, IE : clrType; return deserializer.ReadInline(resourceWrapper, edmType, nestedReadContext); } - private void ApplyResourceSetInNestedProperty(IEdmProperty nestedProperty, object resource, - ODataResourceSetWrapper resourceSetWrapper, ODataDeserializerContext readContext) + ODataResourceSetWrapperBase resourceSetWrapper, ODataDeserializerContext readContext) { Contract.Assert(nestedProperty != null); Contract.Assert(resource != null); Contract.Assert(readContext != null); - if (readContext.IsDeltaOfT) - { - IEdmNavigationProperty navigationProperty = nestedProperty as IEdmNavigationProperty; - if (navigationProperty != null) - { - string message = Error.Format(SRResources.CannotPatchNavigationProperties, navigationProperty.Name, - navigationProperty.DeclaringEntityType().FullName()); - throw new ODataException(message); - } - } - object value = ReadNestedResourceSetInline(resourceSetWrapper, nestedProperty.Type, readContext); string propertyName = EdmLibHelpers.GetClrPropertyName(nestedProperty, readContext.Model); - DeserializationHelpers.SetCollectionProperty(resource, nestedProperty, value, propertyName); + DeserializationHelpers.SetCollectionProperty(resource, nestedProperty, value, propertyName, resourceSetWrapper.ResourceSetType == ResourceSetType.DeltaResourceSet); } private void ApplyDynamicResourceSetInNestedProperty(string propertyName, object resource, IEdmStructuredTypeReference structuredType, - ODataResourceSetWrapper resourceSetWrapper, ODataDeserializerContext readContext) + ODataResourceSetWrapperBase resourceSetWrapper, ODataDeserializerContext readContext) { Contract.Assert(resource != null); Contract.Assert(readContext != null); - if (String.IsNullOrEmpty(resourceSetWrapper.ResourceSet.TypeName)) + if (String.IsNullOrEmpty(resourceSetWrapper.ResourceSetBase.TypeName)) { string message = Error.Format(SRResources.DynamicResourceSetTypeNameIsRequired, propertyName); throw new ODataException(message); } string elementTypeName = - DeserializationHelpers.GetCollectionElementTypeName(resourceSetWrapper.ResourceSet.TypeName, + DeserializationHelpers.GetCollectionElementTypeName(resourceSetWrapper.ResourceSetBase.TypeName, isNested: false); IEdmSchemaType elementType = readContext.Model.FindDeclaredType(elementTypeName); @@ -583,7 +812,7 @@ private void ApplyDynamicResourceSetInNestedProperty(string propertyName, object result, collectionType, readContext.Model); } - private object ReadNestedResourceSetInline(ODataResourceSetWrapper resourceSetWrapper, IEdmTypeReference edmType, + private object ReadNestedResourceSetInline(ODataResourceSetWrapperBase resourceSetWrapper, IEdmTypeReference edmType, ODataDeserializerContext readContext) { Contract.Assert(resourceSetWrapper != null); @@ -601,14 +830,15 @@ private object ReadNestedResourceSetInline(ODataResourceSetWrapper resourceSetWr { Path = readContext.Path, Model = readContext.Model, - Request = readContext.Request, + Request = readContext.Request }; if (readContext.IsUntyped) { if (structuredType.IsEntity()) { - nestedReadContext.ResourceType = typeof(EdmEntityObjectCollection); + nestedReadContext.ResourceType = (readContext.IsDeltaOfT && resourceSetWrapper.ResourceSetType == ResourceSetType.DeltaResourceSet)? + typeof(EdmChangedObjectCollection): typeof(EdmEntityObjectCollection); } else { @@ -625,7 +855,8 @@ private object ReadNestedResourceSetInline(ODataResourceSetWrapper resourceSetWr Error.Format(SRResources.MappingDoesNotContainResourceType, structuredType.FullName())); } - nestedReadContext.ResourceType = typeof(List<>).MakeGenericType(clrType); + nestedReadContext.ResourceType = (readContext.IsDeltaOfT && resourceSetWrapper.ResourceSetType == ResourceSetType.DeltaResourceSet) + ? typeof(DeltaSet<>).MakeGenericType(clrType) : typeof(List<>).MakeGenericType(clrType); } return deserializer.ReadInline(resourceSetWrapper, edmType, nestedReadContext); diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetDeserializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetDeserializer.cs index b0d180f590..27aa8972e8 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetDeserializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetDeserializer.cs @@ -1,8 +1,14 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; +using System.Collections.Generic; +using System.Collections.ObjectModel; using System.Diagnostics.Contracts; using System.Linq; using System.Reflection; @@ -48,7 +54,7 @@ public override object Read(ODataMessageReader messageReader, Type type, ODataDe throw Error.Argument("edmType", SRResources.ArgumentMustBeOfType, EdmTypeKind.Complex + " or " + EdmTypeKind.Entity); } - ODataReader resourceSetReader = messageReader.CreateODataResourceSetReader(); + ODataReader resourceSetReader = readContext.IsChangedObjectCollection ? messageReader.CreateODataDeltaResourceSetReader() : messageReader.CreateODataResourceSetReader(); object resourceSet = resourceSetReader.ReadResourceOrResourceSet(); return ReadInline(resourceSet, edmType, readContext); } @@ -70,12 +76,13 @@ public override async Task ReadAsync(ODataMessageReader messageReader, T throw Error.Argument("edmType", SRResources.ArgumentMustBeOfType, EdmTypeKind.Complex + " or " + EdmTypeKind.Entity); } - ODataReader resourceSetReader = await messageReader.CreateODataResourceSetReaderAsync(); + ODataReader resourceSetReader = readContext.IsChangedObjectCollection ? await messageReader.CreateODataDeltaResourceSetReaderAsync() : await messageReader.CreateODataResourceSetReaderAsync(); object resourceSet = await resourceSetReader.ReadResourceOrResourceSetAsync(); return ReadInline(resourceSet, edmType, readContext); } /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling")] public sealed override object ReadInline(object item, IEdmTypeReference edmType, ODataDeserializerContext readContext) { if (item == null) @@ -93,20 +100,46 @@ public sealed override object ReadInline(object item, IEdmTypeReference edmType, throw Error.Argument("edmType", SRResources.TypeMustBeResourceSet, edmType.ToTraceString()); } - ODataResourceSetWrapper resourceSet = item as ODataResourceSetWrapper; + ODataResourceSetWrapperBase resourceSet = item as ODataResourceSetWrapperBase; if (resourceSet == null) { - throw Error.Argument("item", SRResources.ArgumentMustBeOfType, typeof(ODataResourceSetWrapper).Name); + throw Error.Argument("item", SRResources.ArgumentMustBeOfType, typeof(ODataResourceSetWrapperBase).Name); } // Recursion guard to avoid stack overflows RuntimeHelpers.EnsureSufficientExecutionStack(); - IEdmStructuredTypeReference elementType = edmType.AsCollection().ElementType().AsStructured(); + IEdmStructuredTypeReference elementType = edmType.AsCollection().ElementType().AsStructured(); IEnumerable result = ReadResourceSet(resourceSet, elementType, readContext); - if (result != null && elementType.IsComplex()) + + //Handle Delta requests to create EdmChangedObjectCollection + if (resourceSet.ResourceSetType == ResourceSetType.DeltaResourceSet) { + IEdmEntityType actualType = elementType.AsEntity().Definition as IEdmEntityType; + + if (readContext.IsUntyped) + { + EdmChangedObjectCollection edmCollection = new EdmChangedObjectCollection(actualType); + + foreach (IEdmChangedObject changedObject in result) + { + edmCollection.Add(changedObject); + } + + return edmCollection; + } + else + { + ICollection deltaSet; + deltaSet = CreateDeltaSet(actualType.Key().Select(x=>x.Name).ToList(), readContext, elementType, result); + + return deltaSet; + } + } + + if (result != null && elementType.IsComplex()) + { if (readContext.IsUntyped) { EdmComplexObjectCollection complexCollection = new EdmComplexObjectCollection(edmType.AsCollection()); @@ -124,13 +157,29 @@ public sealed override object ReadInline(object item, IEdmTypeReference edmType, IEnumerable; return castedResult; } - } + } else { return result; } } + private static ICollection CreateDeltaSet(IList keys, ODataDeserializerContext readContext, IEdmStructuredTypeReference elementType, IEnumerable result) + { + ICollection deltaSet; + Type type = EdmLibHelpers.GetClrType(elementType, readContext.Model); + Type changedObjCollType = typeof(DeltaSet<>).MakeGenericType(type); + + deltaSet = Activator.CreateInstance(changedObjCollType, keys) as ICollection; + + foreach (IDeltaSetItem changedObject in result) + { + deltaSet.Add(changedObject); + } + + return deltaSet; + } + /// /// Deserializes the given under the given . /// @@ -138,7 +187,7 @@ public sealed override object ReadInline(object item, IEdmTypeReference edmType, /// The deserializer context. /// The element type of the resource set being read. /// The deserialized resource set object. - public virtual IEnumerable ReadResourceSet(ODataResourceSetWrapper resourceSet, IEdmStructuredTypeReference elementType, ODataDeserializerContext readContext) + public virtual IEnumerable ReadResourceSet(ODataResourceSetWrapperBase resourceSet, IEdmStructuredTypeReference elementType, ODataDeserializerContext readContext) { ODataEdmTypeDeserializer deserializer = DeserializerProvider.GetEdmTypeDeserializer(elementType); if (deserializer == null) @@ -147,10 +196,38 @@ public virtual IEnumerable ReadResourceSet(ODataResourceSetWrapper resourceSet, Error.Format(SRResources.TypeCannotBeDeserialized, elementType.FullName())); } - foreach (ODataResourceWrapper resourceWrapper in resourceSet.Resources) + //Ideally we don't need to special case ResourceSetType.ResourceSet, since the code that handles a deltaresourcesetwrapper will also handle a ResourceSetWrapper, + //but it may be more efficient for the common case. + + if (resourceSet.ResourceSetType == ResourceSetType.ResourceSet) { - yield return deserializer.ReadInline(resourceWrapper, elementType, readContext); + foreach (ODataResourceWrapper resourceWrapper in resourceSet.Resources) + { + yield return deserializer.ReadInline(resourceWrapper, elementType, readContext); + } + } + else + { + Type clrType = EdmLibHelpers.GetClrType(elementType, readContext.Model); + + foreach (ODataResourceWrapper resourceWrapper in resourceSet.Resources) + { + if (readContext.IsUntyped) + { + readContext.ResourceType = resourceWrapper.ResourceBase is ODataDeletedResource ? typeof(EdmDeltaDeletedEntityObject) : typeof(EdmEntityObject); + } + else + { + readContext.ResourceType = resourceWrapper.ResourceBase is ODataDeletedResource ? typeof(DeltaDeletedEntityObject<>).MakeGenericType(clrType) : typeof(Delta<>).MakeGenericType(clrType); + } + + if (resourceWrapper != null) + { + yield return deserializer.ReadInline(resourceWrapper, elementType, readContext); + } + } } } + } } diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetWrapper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetWrapper.cs index 7c7e4b80b0..fca2a4cc6b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetWrapper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetWrapper.cs @@ -1,7 +1,13 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ +using System; using System.Collections.Generic; +using Microsoft.AspNet.OData.Common; using Microsoft.OData; namespace Microsoft.AspNet.OData.Formatter.Deserialization @@ -9,32 +15,24 @@ namespace Microsoft.AspNet.OData.Formatter.Deserialization /// /// Encapsulates an and the 's that are part of it. /// - public sealed class ODataResourceSetWrapper : ODataItemBase + public sealed class ODataResourceSetWrapper : ODataResourceSetWrapperBase { /// /// Initializes a new instance of . /// - /// The wrapped item. + /// The wrapped item. public ODataResourceSetWrapper(ODataResourceSet item) : base(item) { - Resources = new List(); + ResourceSet = item; } + internal override ResourceSetType ResourceSetType => ResourceSetType.ResourceSet; + /// /// Gets the wrapped . /// - public ODataResourceSet ResourceSet - { - get - { - return Item as ODataResourceSet; - } - } + public ODataResourceSet ResourceSet { get; } - /// - /// Gets the nested resources of this ResourceSet. - /// - public IList Resources { get; private set; } } } diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetWrapperBase.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetWrapperBase.cs new file mode 100644 index 0000000000..6b08110768 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceSetWrapperBase.cs @@ -0,0 +1,41 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.OData; + +namespace Microsoft.AspNet.OData.Formatter.Deserialization +{ + /// + /// Encapsulates an or and the 's that are part of it. + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1012:AbstractTypesShouldNotHaveConstructors")] + public abstract class ODataResourceSetWrapperBase : ODataItemBase + { + /// + /// To determine the type of Resource Set + /// + internal abstract ResourceSetType ResourceSetType { get; } + + /// + /// Initializes a new instance of . + /// + /// The wrapped item. + public ODataResourceSetWrapperBase(ODataResourceSetBase item) + : base(item) + { + Resources = new List(); + ResourceSetBase = item; + } + + /// + /// Gets the wrapped . + /// + public ODataResourceSetBase ResourceSetBase { get; } + + /// + /// Gets the members of this ResourceSet. + /// + public IList Resources { get; } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceWrapper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceWrapper.cs index f78be998a6..7a5949a27b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceWrapper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ODataResourceWrapper.cs @@ -1,7 +1,13 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ +using System; using System.Collections.Generic; +using Microsoft.AspNet.OData.Common; using Microsoft.OData; namespace Microsoft.AspNet.OData.Formatter.Deserialization @@ -10,20 +16,27 @@ namespace Microsoft.AspNet.OData.Formatter.Deserialization /// Encapsulates an and the inner nested resource infos. /// public sealed class ODataResourceWrapper : ODataItemBase - { + { /// /// Initializes a new instance of . /// /// The wrapped item. - public ODataResourceWrapper(ODataResource item) + public ODataResourceWrapper(ODataResourceBase item) : base(item) { NestedResourceInfos = new List(); + ResourceBase = item; } + + /// + /// Gets the wrapped . + /// + public ODataResourceBase ResourceBase {get;} /// - /// Gets the wrapped . + /// Gets the wrapped . This will return null for deleted resources. /// + [Obsolete("Please use ResourceBase instead")] public ODataResource Resource { get diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ResourceSetType.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ResourceSetType.cs new file mode 100644 index 0000000000..70799cd070 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Deserialization/ResourceSetType.cs @@ -0,0 +1,25 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Text; + +namespace Microsoft.AspNet.OData.Formatter.Deserialization +{ + /// + /// Enum to determine the type of Resource Set + /// + internal enum ResourceSetType + { + /// + /// A normal ResourceSet + /// + ResourceSet, + + /// + /// A Delta Resource Set + /// + DeltaResourceSet + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ETag.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ETag.cs index fb77643637..885eea8f3f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ETag.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ETag.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ETagOfTEntity.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ETagOfTEntity.cs index 7385e9ce60..3ec0e0036f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ETagOfTEntity.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ETagOfTEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/EdmLibHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/EdmLibHelpers.cs index 7a907d1887..659c5bc2e6 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/EdmLibHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/EdmLibHelpers.cs @@ -1,7 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; +using System.Collections; using System.Collections.Generic; #if NETFX // System.Data.Linq.Binary is only supported in the AspNet version. using System.Data.Linq; @@ -130,13 +135,23 @@ private static IEdmType GetEdmType(IEdmModel edmModel, Type clrType, bool testCo { if (testCollections) { + Type entityType; + + if (IsDeltaSetWrapper(clrType, out entityType)) + { + IEdmType elementType = GetEdmType(edmModel, entityType, testCollections: false); + if (elementType != null) + { + return new EdmCollectionType(elementType.ToEdmTypeReference(IsNullable(entityType))); + } + } + Type enumerableOfT = ExtractGenericInterface(clrType, typeof(IEnumerable<>)); if (enumerableOfT != null) { Type elementClrType = enumerableOfT.GetGenericArguments()[0]; - // IEnumerable> is a collection of T. - Type entityType; + // IEnumerable> is a collection of T. if (IsSelectExpandWrapper(elementClrType, out entityType)) { elementClrType = entityType; @@ -901,14 +916,17 @@ internal static IEdmTypeReference GetExpectedPayloadType(Type type, ODataPath pa { IEdmTypeReference expectedPayloadType = null; - if (typeof(IEdmObject).IsAssignableFrom(type)) + if (typeof(IEdmObject).IsAssignableFrom(type) || typeof(IDeltaSet).IsAssignableFrom(type)) { // typeless mode. figure out the expected payload type from the OData Path. IEdmType edmType = path.EdmType; if (edmType != null) { expectedPayloadType = EdmLibHelpers.ToEdmTypeReference(edmType, isNullable: false); - if (expectedPayloadType.TypeKind() == EdmTypeKind.Collection) + + //This loop should execute only if its not a type of edmchangedobjectcollection, In case of edmchangedobjectcollection, + //Expectedpayloadtype should not be of elementytype, but of collection. + if (expectedPayloadType.TypeKind() == EdmTypeKind.Collection && !(typeof(ICollection).IsAssignableFrom(type) || typeof(IDeltaSet).IsAssignableFrom(type))) { IEdmTypeReference elementType = expectedPayloadType.AsCollection().ElementType(); if (elementType.IsEntity()) @@ -1041,6 +1059,7 @@ private static IEdmPrimitiveType GetPrimitiveType(EdmPrimitiveTypeKind primitive } private static bool IsSelectExpandWrapper(Type type, out Type entityType) => IsTypeWrapper(typeof(SelectExpandWrapper<>), type, out entityType); + private static bool IsDeltaSetWrapper(Type type, out Type entityType) => IsTypeWrapper(typeof(DeltaSet<>), type, out entityType); internal static bool IsComputeWrapper(Type type, out Type entityType) => IsTypeWrapper(typeof(ComputeWrapper<>), type, out entityType); diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/EdmObjectHelper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/EdmObjectHelper.cs index bbf0fd96c9..0e4509c6e3 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/EdmObjectHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/EdmObjectHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/EdmPrimitiveHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/EdmPrimitiveHelpers.cs index b93c16ddfc..f99982ce33 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/EdmPrimitiveHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/EdmPrimitiveHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/EdmTypeReferenceEqualityComparer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/EdmTypeReferenceEqualityComparer.cs index f502275efa..8b7bf9d35e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/EdmTypeReferenceEqualityComparer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/EdmTypeReferenceEqualityComparer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/IETagHandler.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/IETagHandler.cs index 4e98d05874..564650a0f4 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/IETagHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/IETagHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataBinaryValueMediaTypeMapping.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataBinaryValueMediaTypeMapping.cs index ab02aec3ae..cbab5ba8c8 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataBinaryValueMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataBinaryValueMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.OData.UriParser; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataCountMediaTypeMapping.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataCountMediaTypeMapping.cs index 5ff4597ad7..d7114fd40f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataCountMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataCountMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.OData.UriParser; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataEnumValueMediaTypeMapping.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataEnumValueMediaTypeMapping.cs index 3527518300..1fe73617be 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataEnumValueMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataEnumValueMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.OData.UriParser; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataInputFormatterHelper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataInputFormatterHelper.cs index 3ccc9a0341..8ecd8ed6ce 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataInputFormatterHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataInputFormatterHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMediaTypes.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMediaTypes.cs index 3dbc4523d6..8496e956a0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMediaTypes.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMediaTypes.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMessageWrapper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMessageWrapper.cs index 16dc5406bd..d8e41b08d9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMessageWrapper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMessageWrapper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -168,4 +172,4 @@ protected void Dispose(bool disposing) } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMetadataLevel.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMetadataLevel.cs index 1cde7a780b..a33df4ae34 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMetadataLevel.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataMetadataLevel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Formatter { diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataModelBinderConverter.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataModelBinderConverter.cs index 7ac3f06f75..f7eea7088c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataModelBinderConverter.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataModelBinderConverter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -31,7 +35,9 @@ namespace Microsoft.AspNet.OData.Formatter public static class ODataModelBinderConverter { private static readonly MethodInfo EnumTryParseMethod = typeof(Enum).GetMethods() - .Single(m => m.Name == "TryParse" && m.GetParameters().Length == 2); + .Single(m => m.Name.Equals("TryParse", StringComparison.Ordinal) + && m.GetParameters().Length == 2 + && m.GetParameters()[0].ParameterType.Equals(typeof(string))); private static readonly MethodInfo CastMethodInfo = typeof(Enumerable).GetMethod("Cast"); @@ -331,7 +337,7 @@ private static object ConvertResource(ODataMessageReader oDataMessageReader, IEd if (edmTypeReference.IsEntity()) { IEdmEntityTypeReference entityType = edmTypeReference.AsEntity(); - return CovertResourceId(value, topLevelResource.Resource, entityType, readContext); + return CovertResourceId(value, topLevelResource.ResourceBase, entityType, readContext); } return value; @@ -344,14 +350,14 @@ private static IEnumerable CovertResourceSetIds(IEnumerable sources, ODataResour int i = 0; foreach (object item in sources) { - object newItem = CovertResourceId(item, resourceSet.Resources[i].Resource, entityTypeReference, + object newItem = CovertResourceId(item, resourceSet.Resources[i].ResourceBase, entityTypeReference, readContext); i++; yield return newItem; } } - private static object CovertResourceId(object source, ODataResource resource, + private static object CovertResourceId(object source, ODataResourceBase resource, IEdmEntityTypeReference entityTypeReference, ODataDeserializerContext readContext) { Contract.Assert(resource != null); diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataOutputFormatterHelper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataOutputFormatterHelper.cs index 8b12a249c2..198b5d61e7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataOutputFormatterHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataOutputFormatterHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -91,7 +95,7 @@ internal static bool CanWriteType( ODataPayloadKind? payloadKind; Type elementType; - if (typeof(IEdmObject).IsAssignableFrom(type) || + if (typeof(IDeltaSet).IsAssignableFrom(type) || typeof(IEdmObject).IsAssignableFrom(type) || (TypeHelper.IsCollection(type, out elementType) && typeof(IEdmObject).IsAssignableFrom(elementType))) { payloadKind = GetEdmObjectPayloadKind(type, internalRequest); @@ -203,6 +207,7 @@ internal static void WriteToStream( writeContext.Path = path; writeContext.MetadataLevel = metadataLevel; writeContext.QueryOptions = internalRequest.Context.QueryOptions; + writeContext.Type = type; //Set the SelectExpandClause on the context if it was explicitly specified. if (selectExpandDifferentFromQueryOptions != null) @@ -247,7 +252,7 @@ internal static void WriteToStream( { return ODataPayloadKind.ResourceSet; } - else if (typeof(IEdmChangedObject).IsAssignableFrom(elementType)) + else if (typeof(IDeltaSetItem).IsAssignableFrom(elementType) || typeof(IEdmChangedObject).IsAssignableFrom(elementType)) { return ODataPayloadKind.Delta; } diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataPrimitiveValueMediaTypeMapping.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataPrimitiveValueMediaTypeMapping.cs index 4b0696c346..d4567da66f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataPrimitiveValueMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataPrimitiveValueMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.OData.UriParser; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataRawValueMediaTypeMapping.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataRawValueMediaTypeMapping.cs index 12d22cd695..7898c9df6d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataRawValueMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataRawValueMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataStreamMediaTypeMapping.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataStreamMediaTypeMapping.cs index aea4019a34..e7d605885b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataStreamMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataStreamMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Formatter { diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataValueExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataValueExtensions.cs index 784fc9d77d..c24f3609b5 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/ODataValueExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/ODataValueExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/QueryStringMediaTypeMapping.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/QueryStringMediaTypeMapping.cs index 3de58c1fdf..1f77618159 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/QueryStringMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/QueryStringMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/DefaultODataSerializerProvider.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/DefaultODataSerializerProvider.cs index 3a863c676b..f814563e25 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/DefaultODataSerializerProvider.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/DefaultODataSerializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -108,6 +112,10 @@ internal ODataSerializer GetODataPayloadSerializerImpl(Type type, Func(); } + else if(TypeHelper.IsTypeAssignableFrom(typeof(IDeltaSet), type)) + { + return _rootContainer.GetRequiredService(); + } // Get the model. Using a Func to delay evaluation of the model // until after the above checks have passed. diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/EntitySelfLinks.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/EntitySelfLinks.cs index a0c1fea720..e50da41329 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/EntitySelfLinks.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/EntitySelfLinks.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataCollectionSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataCollectionSerializer.cs index f38479fd12..c70ba79ff8 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataCollectionSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataCollectionSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataDeltaFeedSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataDeltaFeedSerializer.cs index 617b4bbff1..e0e0aafb9e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataDeltaFeedSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataDeltaFeedSerializer.cs @@ -1,9 +1,16 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; +using System.CodeDom; using System.Collections; +using System.Collections.Generic; using System.Diagnostics.Contracts; +using System.Reflection; using System.Runtime.Serialization; using System.Threading.Tasks; using Microsoft.AspNet.OData.Builder; @@ -21,6 +28,7 @@ namespace Microsoft.AspNet.OData.Formatter.Serialization public class ODataDeltaFeedSerializer : ODataEdmTypeSerializer { private const string DeltaFeed = "deltafeed"; + IEdmStructuredTypeReference _elementType; /// /// Initializes a new instance of . @@ -56,6 +64,7 @@ public override void WriteObject(object graph, Type type, ODataMessageWriter mes } IEdmTypeReference feedType = writeContext.GetEdmType(graph, type); + Contract.Assert(feedType != null); IEdmEntityTypeReference entityType = GetResourceType(feedType).AsEntity(); @@ -89,6 +98,7 @@ public override async Task WriteObjectAsync(object graph, Type type, ODataMessag } IEdmTypeReference feedType = writeContext.GetEdmType(graph, type); + Contract.Assert(feedType != null); IEdmEntityTypeReference entityType = GetResourceType(feedType).AsEntity(); @@ -182,6 +192,7 @@ private void WriteFeed(IEnumerable enumerable, IEdmTypeReference feedType, OData Contract.Assert(feedType != null); IEdmStructuredTypeReference elementType = GetResourceType(feedType); + _elementType = elementType; if (elementType.IsComplex()) { @@ -230,13 +241,31 @@ private void WriteFeed(IEnumerable enumerable, IEdmTypeReference feedType, OData } lastResource = entry; - IEdmChangedObject edmChangedObject = entry as IEdmChangedObject; - if (edmChangedObject == null) + + EdmDeltaEntityKind deltaEntityKind; + if (writeContext.IsUntyped) { - throw new SerializationException(Error.Format(SRResources.CannotWriteType, GetType().Name, enumerable.GetType().FullName)); + IEdmChangedObject edmChangedObject = entry as IEdmChangedObject; + if (edmChangedObject == null) + { + throw new SerializationException(Error.Format(SRResources.CannotWriteType, GetType().Name, enumerable.GetType().FullName)); + } + + deltaEntityKind = edmChangedObject.DeltaKind; } + else + { + IDeltaSetItem deltaSetItem = entry as IDeltaSetItem; - switch (edmChangedObject.DeltaKind) + if (deltaSetItem == null) + { + throw new SerializationException(Error.Format(SRResources.CannotWriteType, GetType().Name, enumerable.GetType().FullName)); + } + + deltaEntityKind = deltaSetItem.DeltaKind; + } + + switch (deltaEntityKind) { case EdmDeltaEntityKind.DeletedEntry: WriteDeltaDeletedEntry(entry, writer, writeContext); @@ -250,6 +279,7 @@ private void WriteFeed(IEnumerable enumerable, IEdmTypeReference feedType, OData case EdmDeltaEntityKind.Entry: { ODataResourceSerializer entrySerializer = SerializerProvider.GetEdmTypeSerializer(elementType) as ODataResourceSerializer; + if (entrySerializer == null) { throw new SerializationException( @@ -285,6 +315,7 @@ private async Task WriteFeedAsync(IEnumerable enumerable, IEdmTypeReference feed Contract.Assert(feedType != null); IEdmStructuredTypeReference elementType = GetResourceType(feedType); + _elementType = elementType; if (elementType.IsComplex()) { @@ -333,13 +364,32 @@ private async Task WriteFeedAsync(IEnumerable enumerable, IEdmTypeReference feed } lastResource = entry; - IEdmChangedObject edmChangedObject = entry as IEdmChangedObject; - if (edmChangedObject == null) + + EdmDeltaEntityKind deltaEntityKind; + if (writeContext.IsUntyped) + { + IEdmChangedObject edmChangedObject = entry as IEdmChangedObject; + if (edmChangedObject == null) + { + throw new SerializationException(Error.Format(SRResources.CannotWriteType, GetType().Name, enumerable.GetType().FullName)); + } + + deltaEntityKind = edmChangedObject.DeltaKind; + } + else { - throw new SerializationException(Error.Format(SRResources.CannotWriteType, GetType().Name, enumerable.GetType().FullName)); + IDeltaSetItem deltaSetItem = entry as IDeltaSetItem; + + if (deltaSetItem == null) + { + throw new SerializationException(Error.Format(SRResources.CannotWriteType, GetType().Name, enumerable.GetType().FullName)); + } + + deltaEntityKind = deltaSetItem.DeltaKind; } + - switch (edmChangedObject.DeltaKind) + switch (deltaEntityKind) { case EdmDeltaEntityKind.DeletedEntry: await WriteDeltaDeletedEntryAsync(entry, writer, writeContext); @@ -434,15 +484,23 @@ public virtual ODataDeltaResourceSet CreateODataDeltaFeed(IEnumerable feedInstan /// /// The object to be written. /// The to be used for writing. - /// The . + /// The . public virtual void WriteDeltaDeletedEntry(object graph, ODataWriter writer, ODataSerializerContext writeContext) { - ODataDeletedResource deletedResource = GetDeletedResource(graph); - - if (deletedResource != null) + ODataResourceSerializer serializer = SerializerProvider.GetEdmTypeSerializer(_elementType) as ODataResourceSerializer; + ResourceContext resourceContext = serializer.GetResourceContext(graph, writeContext); + SelectExpandNode selectExpandNode = serializer.CreateSelectExpandNode(resourceContext); + + if (selectExpandNode != null) { - writer.WriteStart(deletedResource); - writer.WriteEnd(); + ODataDeletedResource deletedResource = GetDeletedResource(graph, resourceContext, serializer, selectExpandNode, writeContext.IsUntyped); + + if (deletedResource != null) + { + writer.WriteStart(deletedResource); + serializer.WriteDeltaComplexProperties(selectExpandNode, resourceContext, writer); + writer.WriteEnd(); + } } } @@ -452,14 +510,22 @@ public virtual void WriteDeltaDeletedEntry(object graph, ODataWriter writer, ODa /// /// The object to be written. /// The to be used for writing. - /// The . + /// The . public virtual async Task WriteDeltaDeletedEntryAsync(object graph, ODataWriter writer, ODataSerializerContext writeContext) { - ODataDeletedResource deletedResource = GetDeletedResource(graph); - if (deletedResource != null) + ODataResourceSerializer serializer = SerializerProvider.GetEdmTypeSerializer(_elementType) as ODataResourceSerializer; + ResourceContext resourceContext = serializer.GetResourceContext(graph, writeContext); + SelectExpandNode selectExpandNode = serializer.CreateSelectExpandNode(resourceContext); + + if (selectExpandNode != null) { - await writer.WriteStartAsync(deletedResource); - await writer.WriteEndAsync(); + ODataDeletedResource deletedResource = GetDeletedResource(graph, resourceContext, serializer, selectExpandNode, writeContext.IsUntyped); + + if (deletedResource != null) + { + await writer.WriteStartAsync(deletedResource); + await writer.WriteEndAsync(); + } } } @@ -469,7 +535,7 @@ public virtual async Task WriteDeltaDeletedEntryAsync(object graph, ODataWriter /// /// The object to be written. /// The to be used for writing. - /// The . + /// The . public virtual void WriteDeltaDeletedLink(object graph, ODataWriter writer, ODataSerializerContext writeContext) { ODataDeltaDeletedLink deltaDeletedLink = GetDeletedLink(graph); @@ -485,7 +551,7 @@ public virtual void WriteDeltaDeletedLink(object graph, ODataWriter writer, ODat /// /// The object to be written. /// The to be used for writing. - /// The . + /// The . public virtual async Task WriteDeltaDeletedLinkAsync(object graph, ODataWriter writer, ODataSerializerContext writeContext) { ODataDeltaDeletedLink deltaDeletedLink = GetDeletedLink(graph); @@ -501,7 +567,7 @@ public virtual async Task WriteDeltaDeletedLinkAsync(object graph, ODataWriter w /// /// The object to be written. /// The to be used for writing. - /// The . + /// The . public virtual void WriteDeltaLink(object graph, ODataWriter writer, ODataSerializerContext writeContext) { ODataDeltaLink deltaLink = GetDeltaLink(graph); @@ -517,7 +583,7 @@ public virtual void WriteDeltaLink(object graph, ODataWriter writer, ODataSerial /// /// The object to be written. /// The to be used for writing. - /// The . + /// The . public async Task WriteDeltaLinkAsync(object graph, ODataWriter writer, ODataSerializerContext writeContext) { ODataDeltaLink deltaLink = GetDeltaLink(graph); @@ -527,26 +593,46 @@ public async Task WriteDeltaLinkAsync(object graph, ODataWriter writer, ODataSer } } - private ODataDeletedResource GetDeletedResource(object graph) + + private ODataDeletedResource GetDeletedResource(object graph, ResourceContext resourceContext, ODataResourceSerializer serializer, SelectExpandNode selectExpandNode, bool isUntyped) { - EdmDeltaDeletedEntityObject edmDeltaDeletedEntity = graph as EdmDeltaDeletedEntityObject; - if (edmDeltaDeletedEntity == null) + IEdmNavigationSource navigationSource; + ODataDeletedResource deletedResource = serializer.CreateDeletedResource(selectExpandNode, resourceContext); + + if (isUntyped) { - throw new SerializationException(Error.Format(SRResources.CannotWriteType, GetType().Name, graph.GetType().FullName)); - } + EdmDeltaDeletedEntityObject edmDeltaDeletedEntity = graph as EdmDeltaDeletedEntityObject; + if (edmDeltaDeletedEntity == null) + { + throw new SerializationException(Error.Format(SRResources.CannotWriteType, GetType().Name, graph.GetType().FullName)); + } - Uri id = StringToUri(edmDeltaDeletedEntity.Id); - ODataDeletedResource deletedResource = new ODataDeletedResource(id, edmDeltaDeletedEntity.Reason); + deletedResource.Id = StringToUri(edmDeltaDeletedEntity.Id??string.Empty); + deletedResource.Reason = edmDeltaDeletedEntity.Reason; + navigationSource = edmDeltaDeletedEntity.NavigationSource; + } + else + { + IDeltaDeletedEntityObject deltaDeletedEntity = graph as IDeltaDeletedEntityObject; + if (deltaDeletedEntity == null) + { + throw new SerializationException(Error.Format(SRResources.CannotWriteType, GetType().Name, graph.GetType().FullName)); + } - if (edmDeltaDeletedEntity.NavigationSource != null) + deletedResource.Id = deltaDeletedEntity.Id; + deletedResource.Reason = deltaDeletedEntity.Reason; + navigationSource = deltaDeletedEntity.NavigationSource; + } + + if (navigationSource != null) { ODataResourceSerializationInfo serializationInfo = new ODataResourceSerializationInfo { - NavigationSourceName = edmDeltaDeletedEntity.NavigationSource.Name + NavigationSourceName = navigationSource.Name }; deletedResource.SetSerializationInfo(serializationInfo); } - + return deletedResource; } diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEdmTypeSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEdmTypeSerializer.cs index e3e5ffba1a..f1065cf86a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEdmTypeSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEdmTypeSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEntityReferenceLinkSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEntityReferenceLinkSerializer.cs index ab8593a850..8e95550ea6 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEntityReferenceLinkSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEntityReferenceLinkSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Runtime.CompilerServices; @@ -83,4 +87,4 @@ private ODataEntityReferenceLink GetEntityReferenceLink(object graph) return entityReferenceLink; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEntityReferenceLinksSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEntityReferenceLinksSerializer.cs index 8ea1ee3bc4..db5037db24 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEntityReferenceLinksSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEntityReferenceLinksSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEnumSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEnumSerializer.cs index d414b388c5..4d31927fce 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEnumSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataEnumSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; @@ -189,4 +193,4 @@ private static bool ShouldSuppressTypeNameSerialization(ODataMetadataLevel metad } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataErrorSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataErrorSerializer.cs index 33d3dffe18..95b9e7bc3b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataErrorSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataErrorSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Runtime.Serialization; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataMetadataSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataMetadataSerializer.cs index 862b0e6a27..fb9f335031 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataMetadataSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataMetadataSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataPayloadKindHelper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataPayloadKindHelper.cs index 840b3472ec..578233c3fb 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataPayloadKindHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataPayloadKindHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataPrimitiveSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataPrimitiveSerializer.cs index de7f9f78b3..9c20c83c00 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataPrimitiveSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataPrimitiveSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; #if NETFX // System.Data.Linq.Binary is only supported in the AspNet version. diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataRawValueSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataRawValueSerializer.cs index 9f5bc902ae..24171dd48e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataRawValueSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataRawValueSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSerializer.cs index 02ffd1b8c8..9783fd9052 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Concurrent; @@ -234,7 +238,7 @@ private async Task WriteDeltaResourceAsync(object graph, ODataWriter writer, ODa } } - private ResourceContext GetResourceContext(object graph, ODataSerializerContext writeContext) + internal ResourceContext GetResourceContext(object graph, ODataSerializerContext writeContext) { Contract.Assert(writeContext != null); @@ -249,7 +253,7 @@ private ResourceContext GetResourceContext(object graph, ODataSerializerContext return resourceContext; } - private void WriteDeltaComplexProperties(SelectExpandNode selectExpandNode, + internal void WriteDeltaComplexProperties(SelectExpandNode selectExpandNode, ResourceContext resourceContext, ODataWriter writer) { Contract.Assert(resourceContext != null); @@ -684,6 +688,14 @@ public virtual SelectExpandNode CreateSelectExpandNode(ResourceContext resourceC /// The created . public virtual ODataResource CreateResource(SelectExpandNode selectExpandNode, ResourceContext resourceContext) { + ODataResource resource = CreateResourceBase(selectExpandNode, resourceContext, false) as ODataResource; + return resource; + } + + + private ODataResourceBase CreateResourceBase(SelectExpandNode selectExpandNode, ResourceContext resourceContext, bool isDeletedResource) + { + if (selectExpandNode == null) { throw Error.ArgumentNull("selectExpandNode"); @@ -696,6 +708,14 @@ public virtual ODataResource CreateResource(SelectExpandNode selectExpandNode, R if (resourceContext.SerializerContext.ExpandReference) { + if (isDeletedResource) + { + return new ODataDeletedResource + { + Id = resourceContext.GenerateSelfLink(false) + }; + } + return new ODataResource { Id = resourceContext.GenerateSelfLink(false) @@ -703,11 +723,25 @@ public virtual ODataResource CreateResource(SelectExpandNode selectExpandNode, R } string typeName = resourceContext.StructuredType.FullTypeName(); - ODataResource resource = new ODataResource + ODataResourceBase resource; + + if (isDeletedResource) { - TypeName = typeName, - Properties = CreateStructuralPropertyBag(selectExpandNode, resourceContext), - }; + resource = new ODataDeletedResource + { + TypeName = typeName, + Properties = CreateStructuralPropertyBag(selectExpandNode, resourceContext), + }; + } + else + { + resource = new ODataResource + { + TypeName = typeName, + Properties = CreateStructuralPropertyBag(selectExpandNode, resourceContext), + }; + } + if (resourceContext.EdmObject is EdmDeltaEntityObject && resourceContext.NavigationSource != null) { @@ -756,7 +790,7 @@ public virtual ODataResource CreateResource(SelectExpandNode selectExpandNode, R AddTypeNameAnnotationAsNeeded(resource, pathType, resourceContext.SerializerContext.MetadataLevel); } - if (resourceContext.StructuredType.TypeKind == EdmTypeKind.Entity && resourceContext.NavigationSource != null) + if (!isDeletedResource && resourceContext.StructuredType.TypeKind == EdmTypeKind.Entity && resourceContext.NavigationSource != null) { if (!(resourceContext.NavigationSource is IEdmContainedEntitySet)) { @@ -790,6 +824,19 @@ public virtual ODataResource CreateResource(SelectExpandNode selectExpandNode, R return resource; } + /// + /// Creates the to be written while writing this resource. + /// + /// The describing the response graph. + /// The context for the resource instance being written. + /// The created . + public virtual ODataDeletedResource CreateDeletedResource(SelectExpandNode selectExpandNode, ResourceContext resourceContext) + { + ODataDeletedResource resource = CreateResourceBase(selectExpandNode, resourceContext, true) as ODataDeletedResource; + return resource; + } + + /// /// Appends the dynamic properties of primitive, enum or the collection of them into the given . /// If the dynamic property is a property of the complex or collection of complex, it will be saved into @@ -800,7 +847,7 @@ public virtual ODataResource CreateResource(SelectExpandNode selectExpandNode, R /// The context for the resource instance being written. [SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Justification = "Relies on many classes.")] [SuppressMessage("Microsoft.Maintainability", "CA1502:AvoidExcessiveComplexity", Justification = "These are simple conversion function and cannot be split up.")] - public virtual void AppendDynamicProperties(ODataResource resource, SelectExpandNode selectExpandNode, + public virtual void AppendDynamicProperties(ODataResourceBase resource, SelectExpandNode selectExpandNode, ResourceContext resourceContext) { Contract.Assert(resource != null); @@ -927,102 +974,60 @@ public virtual void AppendDynamicProperties(ODataResource resource, SelectExpand /// /// The describing the resource, which is being annotated. /// The context for the resource instance, which is being annotated. - public virtual void AppendInstanceAnnotations(ODataResource resource, ResourceContext resourceContext) + public virtual void AppendInstanceAnnotations(ODataResourceBase resource, ResourceContext resourceContext) { IEdmStructuredType structuredType = resourceContext.StructuredType; IEdmStructuredObject structuredObject = resourceContext.EdmObject; + + //For appending transient and persistent instance annotations for both enity object and normal resources + PropertyInfo instanceAnnotationInfo = EdmLibHelpers.GetInstanceAnnotationsContainer(structuredType, resourceContext.EdmModel); - object value; - - if (instanceAnnotationInfo == null || structuredObject == null || - !structuredObject.TryGetPropertyValue(instanceAnnotationInfo.Name, out value) || value == null) - { - return; - } + EdmEntityObject edmEntityObject = null; + object instanceAnnotations = null; + IODataInstanceAnnotationContainer transientAnnotations = null; - IODataInstanceAnnotationContainer instanceAnnotationContainer = value as IODataInstanceAnnotationContainer; + IDelta delta = null; - if (instanceAnnotationContainer != null) + if (resourceContext.SerializerContext.IsDeltaOfT) { - IDictionary clrAnnotations = instanceAnnotationContainer.GetResourceAnnotations(); - - if (clrAnnotations != null) - { - foreach (KeyValuePair annotation in clrAnnotations) - { - AddODataAnnotations(resource.InstanceAnnotations, resourceContext, annotation); - } - } - - foreach(ODataProperty property in resource.Properties) - { - string propertyName = property.Name; - - if (property.InstanceAnnotations == null) - { - property.InstanceAnnotations = new List(); - } - - IDictionary propertyAnnotations = instanceAnnotationContainer.GetPropertyAnnotations(propertyName); - - if (propertyAnnotations != null) - { - foreach (KeyValuePair annotation in propertyAnnotations) - { - AddODataAnnotations(property.InstanceAnnotations, resourceContext, annotation); - } - } - } + delta = resourceContext.ResourceInstance as IDelta; } - } - private void AddODataAnnotations(ICollection InstanceAnnotations, ResourceContext resourceContext, KeyValuePair annotation) - { - ODataValue annotationValue = null; - - if (annotation.Value != null) + if (delta != null) { - IEdmTypeReference edmTypeReference = resourceContext.SerializerContext.GetEdmType(annotation.Value, - annotation.Value.GetType()); + if (instanceAnnotationInfo != null) + { + delta.TryGetPropertyValue(instanceAnnotationInfo.Name, out instanceAnnotations); + + } - ODataEdmTypeSerializer edmTypeSerializer = GetEdmTypeSerializer(edmTypeReference); + IDeltaSetItem deltaitem = resourceContext.ResourceInstance as IDeltaSetItem; - if (edmTypeSerializer != null) + if(deltaitem != null) { - annotationValue = edmTypeSerializer.CreateODataValue(annotation.Value, edmTypeReference, resourceContext.SerializerContext); + transientAnnotations = deltaitem.TransientInstanceAnnotationContainer; } } else { - annotationValue = new ODataNullValue(); - } - - if (annotationValue != null) - { - InstanceAnnotations.Add(new ODataInstanceAnnotation(annotation.Key, annotationValue)); - } - } + if (instanceAnnotationInfo == null || structuredObject == null || + !structuredObject.TryGetPropertyValue(instanceAnnotationInfo.Name, out instanceAnnotations) || instanceAnnotations == null) + { + edmEntityObject = structuredObject as EdmEntityObject; - private ODataEdmTypeSerializer GetEdmTypeSerializer(IEdmTypeReference edmTypeReference) - { - ODataEdmTypeSerializer edmTypeSerializer; - - if (edmTypeReference.IsCollection()) - { - edmTypeSerializer = new ODataCollectionSerializer(SerializerProvider, true); - } - else if (edmTypeReference.IsStructured()) - { - edmTypeSerializer = new ODataResourceValueSerializer(SerializerProvider); - } - else - { - edmTypeSerializer = SerializerProvider.GetEdmTypeSerializer(edmTypeReference); + if (edmEntityObject != null) + { + instanceAnnotations = edmEntityObject.PersistentInstanceAnnotationsContainer; + transientAnnotations = edmEntityObject.TransientInstanceAnnotationContainer; + } + } } - return edmTypeSerializer; + ODataSerializerHelper.AppendInstanceAnnotations(resource, resourceContext, instanceAnnotations, SerializerProvider); + + ODataSerializerHelper.AppendInstanceAnnotations(resource, resourceContext, transientAnnotations, SerializerProvider); } /// @@ -1613,6 +1618,8 @@ private IEnumerable CreateStructuralPropertyBag(SelectExpandNode structuralProperties = structuralProperties.Where(p => changedProperties.Contains(p.Name)); } + bool isDeletedEntity = resourceContext.EdmObject is EdmDeltaDeletedEntityObject; + foreach (IEdmStructuralProperty structuralProperty in structuralProperties) { if (structuralProperty.Type != null && structuralProperty.Type.IsStream()) @@ -1622,11 +1629,13 @@ private IEnumerable CreateStructuralPropertyBag(SelectExpandNode } ODataProperty property = CreateStructuralProperty(structuralProperty, resourceContext); - if (property != null) + if (property == null || (isDeletedEntity && property.Value == null) ) { - properties.Add(property); + continue; } - } + + properties.Add(property); + } } return properties; @@ -1944,7 +1953,7 @@ private static IEdmStructuredType GetODataPathType(ODataSerializerContext serial } } - internal static void AddTypeNameAnnotationAsNeeded(ODataResource resource, IEdmStructuredType odataPathType, + internal static void AddTypeNameAnnotationAsNeeded(ODataResourceBase resource, IEdmStructuredType odataPathType, ODataMetadataLevel metadataLevel) { // ODataLib normally has the caller decide whether or not to serialize properties by leaving properties @@ -1969,7 +1978,7 @@ internal static void AddTypeNameAnnotationAsNeeded(ODataResource resource, IEdmS resource.TypeAnnotation = new ODataTypeAnnotation(typeName); } - internal static void AddTypeNameAnnotationAsNeededForComplex(ODataResource resource, ODataMetadataLevel metadataLevel) + internal static void AddTypeNameAnnotationAsNeededForComplex(ODataResourceBase resource, ODataMetadataLevel metadataLevel) { // ODataLib normally has the caller decide whether or not to serialize properties by leaving properties // null when values should not be serialized. The TypeName property is different and should always be @@ -2043,7 +2052,7 @@ internal static bool ShouldOmitOperation(IEdmOperation operation, OperationLinkB } } - internal static bool ShouldSuppressTypeNameSerialization(ODataResource resource, IEdmStructuredType edmType, + internal static bool ShouldSuppressTypeNameSerialization(ODataResourceBase resource, IEdmStructuredType edmType, ODataMetadataLevel metadataLevel) { Contract.Assert(resource != null); diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSetSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSetSerializer.cs index 98ba88f5eb..e8a9ef1084 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSetSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceSetSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceValueSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceValueSerializer.cs index 0be29f7df0..8f1f1515a2 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceValueSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataResourceValueSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializer.cs index ddbff2c5b5..d1773cc4ce 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; @@ -59,4 +63,4 @@ public virtual Task WriteObjectAsync(object graph, Type type, ODataMessageWriter return Task.Run(() => WriteObject(graph, type, messageWriter, writeContext)); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerContext.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerContext.cs index f98cfce09c..914ff6054a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerContext.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -23,6 +27,8 @@ public partial class ODataSerializerContext private ODataQueryContext _queryContext; private SelectExpandClause _selectExpandClause; private bool _isSelectExpandClauseSet; + private bool? _isUntyped; + private bool? _isDeltaOfT; /// /// Initializes a new instance of the class. @@ -159,6 +165,34 @@ internal ODataQueryContext QueryContext /// public ODataPath Path { get; set; } + internal Type Type { get; set; } + + internal bool IsUntyped + { + get + { if (_isUntyped == null) + { + _isUntyped = typeof(IEdmObject).IsAssignableFrom(Type); + } + + return _isUntyped.Value; + } + } + + internal bool IsDeltaOfT + { + get + { + if (_isDeltaOfT == null) + { + _isDeltaOfT = Type != null && TypeHelper.IsGenericType(Type) && (Type.GetGenericTypeDefinition() == typeof(DeltaSet<>) || + Type.GetGenericTypeDefinition() == typeof(Delta<>) || Type.GetGenericTypeDefinition() == typeof(DeltaDeletedEntityObject<>)); + } + + return _isDeltaOfT.Value; + } + } + /// /// Gets or sets the root element name which is used when writing primitive and enum types /// @@ -296,6 +330,11 @@ internal IEdmTypeReference GetEdmType(object instance, Type type) } else { + if (typeof(IDeltaSet).IsAssignableFrom(type)) + { + return EdmLibHelpers.ToEdmTypeReference(Path.EdmType, isNullable: false); + } + if (Model == null) { throw Error.InvalidOperation(SRResources.RequestMustHaveModel); @@ -308,7 +347,15 @@ internal IEdmTypeReference GetEdmType(object instance, Type type) { if (instance != null) { - edmType = _typeMappingCache.GetEdmType(instance.GetType(), Model); + TypedDelta delta = instance as TypedDelta; + if (delta != null) + { + edmType = _typeMappingCache.GetEdmType(delta.ExpectedClrType, Model); + } + else + { + edmType = _typeMappingCache.GetEdmType(instance.GetType(), Model); + } } if (edmType == null) diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerHelper.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerHelper.cs new file mode 100644 index 0000000000..a130405301 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerHelper.cs @@ -0,0 +1,108 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.AspNet.OData.Builder; +using Microsoft.OData; +using Microsoft.OData.Edm; + +namespace Microsoft.AspNet.OData.Formatter.Serialization +{ + /// + /// Helper class for OData Serialization + /// + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1053:StaticHolderTypesShouldNotHaveConstructors")] + internal class ODataSerializerHelper + { + internal static void AppendInstanceAnnotations(ODataResourceBase resource, ResourceContext resourceContext, object value, ODataSerializerProvider SerializerProvider) + { + IODataInstanceAnnotationContainer instanceAnnotationContainer = value as IODataInstanceAnnotationContainer; + + if (instanceAnnotationContainer != null) + { + IDictionary clrAnnotations = instanceAnnotationContainer.GetResourceAnnotations(); + + if (clrAnnotations != null) + { + foreach (KeyValuePair annotation in clrAnnotations) + { + AddODataAnnotations(resource.InstanceAnnotations, resourceContext, annotation, SerializerProvider); + } + } + + if (resource.Properties != null) + { + foreach (ODataProperty property in resource.Properties) + { + string propertyName = property.Name; + + if (property.InstanceAnnotations == null) + { + property.InstanceAnnotations = new List(); + } + + IDictionary propertyAnnotations = instanceAnnotationContainer.GetPropertyAnnotations(propertyName); + + if (propertyAnnotations != null) + { + foreach (KeyValuePair annotation in propertyAnnotations) + { + AddODataAnnotations(property.InstanceAnnotations, resourceContext, annotation, SerializerProvider); + } + } + } + } + } + } + + + internal static void AddODataAnnotations(ICollection InstanceAnnotations, ResourceContext resourceContext, KeyValuePair annotation, ODataSerializerProvider SerializerProvider) + { + ODataValue annotationValue = null; + + if (annotation.Value != null) + { + IEdmTypeReference edmTypeReference = resourceContext.SerializerContext.GetEdmType(annotation.Value, + annotation.Value.GetType()); + + ODataEdmTypeSerializer edmTypeSerializer = GetEdmTypeSerializer(edmTypeReference, SerializerProvider); + + if (edmTypeSerializer != null) + { + annotationValue = edmTypeSerializer.CreateODataValue(annotation.Value, edmTypeReference, resourceContext.SerializerContext); + } + } + else + { + annotationValue = new ODataNullValue(); + } + + if (annotationValue != null) + { + InstanceAnnotations.Add(new ODataInstanceAnnotation(annotation.Key, annotationValue)); + } + } + + + private static ODataEdmTypeSerializer GetEdmTypeSerializer(IEdmTypeReference edmTypeReference, ODataSerializerProvider SerializerProvider) + { + ODataEdmTypeSerializer edmTypeSerializer; + + if (edmTypeReference.IsCollection()) + { + edmTypeSerializer = new ODataCollectionSerializer(SerializerProvider, true); + } + else if (edmTypeReference.IsStructured()) + { + edmTypeSerializer = new ODataResourceValueSerializer(SerializerProvider); + } + else + { + edmTypeSerializer = SerializerProvider.GetEdmTypeSerializer(edmTypeReference); + } + + return edmTypeSerializer; + } + + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerProvider.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerProvider.cs index a2d1089257..d6e5fc762e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerProvider.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerProviderExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerProviderExtensions.cs index 38008b67b1..075316af83 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerProviderExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataSerializerProviderExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataServiceDocumentSerializer.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataServiceDocumentSerializer.cs index b1392ce439..10bf24db2f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataServiceDocumentSerializer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/ODataServiceDocumentSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Runtime.Serialization; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/SelectExpandNode.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/SelectExpandNode.cs index 89b2aa8878..a11067de35 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/SelectExpandNode.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/SelectExpandNode.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmComplexObject.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmComplexObject.cs index 66a690fed1..caf70c2f2f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmComplexObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmComplexObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmEntityObject.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmEntityObject.cs index 0af48af2d5..a627a8f47c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmEntityObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmEntityObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; @@ -21,4 +25,4 @@ public TypedEdmEntityObject(object instance, IEdmEntityTypeReference edmType, IE { } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmStructuredObject.cs b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmStructuredObject.cs index 7ea75f1b69..1c7f1d32d6 100644 --- a/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmStructuredObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/Formatter/Serialization/TypedEdmStructuredObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Concurrent; diff --git a/src/Microsoft.AspNet.OData.Shared/FunctionImportComparer.cs b/src/Microsoft.AspNet.OData.Shared/FunctionImportComparer.cs index 5fc44c2bfb..f4a50fbcc1 100644 --- a/src/Microsoft.AspNet.OData.Shared/FunctionImportComparer.cs +++ b/src/Microsoft.AspNet.OData.Shared/FunctionImportComparer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/GetNextPageHelper.cs b/src/Microsoft.AspNet.OData.Shared/GetNextPageHelper.cs index 85e45095e6..3135e2697b 100644 --- a/src/Microsoft.AspNet.OData.Shared/GetNextPageHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/GetNextPageHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/IDelta.cs b/src/Microsoft.AspNet.OData.Shared/IDelta.cs index 30f966dda8..d07c11ff36 100644 --- a/src/Microsoft.AspNet.OData.Shared/IDelta.cs +++ b/src/Microsoft.AspNet.OData.Shared/IDelta.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/IDeltaDeletedEntityObject.cs b/src/Microsoft.AspNet.OData.Shared/IDeltaDeletedEntityObject.cs new file mode 100644 index 0000000000..703ad0f145 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/IDeltaDeletedEntityObject.cs @@ -0,0 +1,31 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using Microsoft.OData; +using Microsoft.OData.Edm; + +namespace Microsoft.AspNet.OData +{ + /// + /// Base interface to represented a typed deleted entity object + /// + public interface IDeltaDeletedEntityObject + { + /// + /// The id of the deleted entity (same as the odata.id returned or computed when calling GET on resource), which may be absolute or relative. + /// + Uri Id { get; set; } + + /// + /// Optional. Either deleted, if the entity was deleted (destroyed), or changed if the entity was removed from membership in the result (i.e., due to a data change). + /// + DeltaDeletedEntryReason? Reason { get; set; } + + /// + /// The navigation source of the deleted entity. If null, then the deleted entity is from the current feed. + /// + IEdmNavigationSource NavigationSource { get; set; } + + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/IDeltaSet.cs b/src/Microsoft.AspNet.OData.Shared/IDeltaSet.cs new file mode 100644 index 0000000000..a09a4f127e --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/IDeltaSet.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +namespace Microsoft.AspNet.OData +{ + /// + /// Basic interface to reperesent a deltaset which is a collection of Deltas. + /// This is being implemented by Deltaset{TStructuralType}. Since its being implementd by a gemeric type and + /// since we need to check in a few places(like deserializer) where the object is a DeltaSet and the {TStructuralType} is not available, + /// we need a marker interface which can be used in these checks. + /// + public interface IDeltaSet + { + + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/IDeltaSetItem.cs b/src/Microsoft.AspNet.OData.Shared/IDeltaSetItem.cs new file mode 100644 index 0000000000..39ea15fb06 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/IDeltaSetItem.cs @@ -0,0 +1,32 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using Microsoft.AspNet.OData.Builder; +using System; +using System.Collections.Generic; +using System.Reflection; +using System.Text; + +namespace Microsoft.AspNet.OData +{ + /// + /// Basic Interface for representing a delta item like delta, deletedentity etc + /// + public interface IDeltaSetItem + { + /// + /// Entry or Deleted Entry for Delta Set Item + /// + EdmDeltaEntityKind DeltaKind { get; } + + /// + /// Annotation container to hold Transient Instance Annotations + /// + IODataInstanceAnnotationContainer TransientInstanceAnnotationContainer { get; set; } + + /// + /// Container to hold ODataId + /// + ODataIdContainer ODataIdContainer { get; set; } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmChangedObject.cs b/src/Microsoft.AspNet.OData.Shared/IEdmChangedObject.cs index 6dc0b68552..2857744988 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmChangedObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmChangedObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData { @@ -15,4 +19,4 @@ public interface IEdmChangedObject : IEdmStructuredObject /// EdmDeltaEntityKind DeltaKind { get; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmComplexObject.cs b/src/Microsoft.AspNet.OData.Shared/IEdmComplexObject.cs index a91d9aceeb..4f1f74ce24 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmComplexObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmComplexObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmDeltaDeletedEntityObject.cs b/src/Microsoft.AspNet.OData.Shared/IEdmDeltaDeletedEntityObject.cs index ed673e5405..6723f353ff 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmDeltaDeletedEntityObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmDeltaDeletedEntityObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData; diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmDeltaDeletedLink.cs b/src/Microsoft.AspNet.OData.Shared/IEdmDeltaDeletedLink.cs index e1734866d6..da20e9442a 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmDeltaDeletedLink.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmDeltaDeletedLink.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData { diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmDeltaLink.cs b/src/Microsoft.AspNet.OData.Shared/IEdmDeltaLink.cs index a03f8af47c..69cc1dbaeb 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmDeltaLink.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmDeltaLink.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData { diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmDeltaLinkBase.cs b/src/Microsoft.AspNet.OData.Shared/IEdmDeltaLinkBase.cs index dde7174cce..91259c9f42 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmDeltaLinkBase.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmDeltaLinkBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmEntityObject.cs b/src/Microsoft.AspNet.OData.Shared/IEdmEntityObject.cs index e1f7ee8a10..4411d0f299 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmEntityObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmEntityObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmEnumObject.cs b/src/Microsoft.AspNet.OData.Shared/IEdmEnumObject.cs index 7441ec5a30..beff4c2874 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmEnumObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmEnumObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmObject.cs b/src/Microsoft.AspNet.OData.Shared/IEdmObject.cs index dd26d9f582..7e51e34282 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/IEdmStructuredObject.cs b/src/Microsoft.AspNet.OData.Shared/IEdmStructuredObject.cs index e4810ca198..fc199328e4 100644 --- a/src/Microsoft.AspNet.OData.Shared/IEdmStructuredObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/IEdmStructuredObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/IODataAPIHandler.cs b/src/Microsoft.AspNet.OData.Shared/IODataAPIHandler.cs new file mode 100644 index 0000000000..dc63ad5370 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/IODataAPIHandler.cs @@ -0,0 +1,15 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +namespace Microsoft.AspNet.OData +{ + /// + /// Base Interface for ODataAPIHandler. + /// This is being implemented by ODataAPIHandler{TStructuralType} which has a method returning nested ODataApiHandler. + /// A generic empty interface is needed since the nestedpatch handler will be of different type. + /// + public interface IODataAPIHandler + { + + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/IPerRouteContainer.cs b/src/Microsoft.AspNet.OData.Shared/IPerRouteContainer.cs index 05ad3377bb..78a4e89393 100644 --- a/src/Microsoft.AspNet.OData.Shared/IPerRouteContainer.cs +++ b/src/Microsoft.AspNet.OData.Shared/IPerRouteContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.OData; diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiActionDescriptor.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiActionDescriptor.cs index a6001ac03b..cba0b19131 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiActionDescriptor.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiActionDescriptor.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiActionMap.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiActionMap.cs index 26eae99504..8b09ea169c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiActionMap.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiActionMap.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Interfaces { @@ -19,5 +23,12 @@ internal interface IWebApiActionMap /// The key. /// True if the key exist; false otherwise. bool Contains(string name); + + /// + /// Gets the action descriptor of the specified action + /// + /// The name of the action + /// The if it exists, otherwise null + IWebApiActionDescriptor GetActionDescriptor(string actionName); } } diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiAssembliesResolver.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiAssembliesResolver.cs index 289035a8dd..ccda04f265 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiAssembliesResolver.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiAssembliesResolver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiContext.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiContext.cs index 0406ca70e6..ef21e904bd 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiContext.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiControllerContext.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiControllerContext.cs index f5f07f244e..2afb0ab2a5 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiControllerContext.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiControllerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Conventions; diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiHeaders.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiHeaders.cs index 03e7523f24..8e95cc99bf 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiHeaders.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiHeaders.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiOptions.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiOptions.cs index 8e082dbe48..cd53a6527f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiOptions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData; diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiRequestMessage.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiRequestMessage.cs index 9a01c41f6a..76c17c186a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiRequestMessage.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiRequestMessage.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiUrlHelper.cs b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiUrlHelper.cs index a4c154642b..273c89f104 100644 --- a/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiUrlHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Interfaces/IWebApiUrlHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing; diff --git a/src/Microsoft.AspNet.OData.Shared/MetadataController.cs b/src/Microsoft.AspNet.OData.Shared/MetadataController.cs index 857f706637..b75e803fe9 100644 --- a/src/Microsoft.AspNet.OData.Shared/MetadataController.cs +++ b/src/Microsoft.AspNet.OData.Shared/MetadataController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Microsoft.AspNet.OData.Shared.projitems b/src/Microsoft.AspNet.OData.Shared/Microsoft.AspNet.OData.Shared.projitems index f424f40b16..21e4d3dd64 100644 --- a/src/Microsoft.AspNet.OData.Shared/Microsoft.AspNet.OData.Shared.projitems +++ b/src/Microsoft.AspNet.OData.Shared/Microsoft.AspNet.OData.Shared.projitems @@ -53,12 +53,18 @@ + + + + + + @@ -71,13 +77,31 @@ + + + + + + + + + + + + + + + + + + @@ -259,6 +283,7 @@ + diff --git a/src/Microsoft.AspNet.OData.Shared/NavigationPath.cs b/src/Microsoft.AspNet.OData.Shared/NavigationPath.cs new file mode 100644 index 0000000000..4b32c53b14 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/NavigationPath.cs @@ -0,0 +1,98 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Concurrent; +using System.Collections.Generic; +using System.Collections.ObjectModel; +using System.Linq; +using Microsoft.OData.UriParser; + +namespace Microsoft.AspNet.OData +{ + /// + /// Navigation Path of an OData ID + /// + public class NavigationPath + { + private string navigationPathName; + private ReadOnlyCollection _pathSegments; + private ConcurrentDictionary _pathItemCache = new ConcurrentDictionary(); + + /// + /// Constructor which takes and odataId and creates PathItems + /// + public NavigationPath() + { + + } + + /// + /// Constructor which takes and odataId and creates PathItems + /// + /// ODataId in string format + /// Pathsegment collection + public NavigationPath(string navigationPath, ReadOnlyCollection pathSegments) + { + navigationPathName = navigationPath; + _pathSegments = pathSegments; + } + + + /// + /// NavigationPath/ODataId in string + /// + public string NavigationPathName { get { return navigationPathName; } } + + /// + /// To Get ODataId in Parsed format + /// + /// Array of PathItems + public PathItem[] GetNavigationPathItems() + { + PathItem[] pathItems; + if(!_pathItemCache.TryGetValue(navigationPathName, out pathItems)) + { + if (_pathSegments != null) + { + pathItems = ParseODataId(); + _pathItemCache.TryAdd(navigationPathName, pathItems); + } + } + + return pathItems; + } + + private PathItem[] ParseODataId() + { + List pathItems = new List(); + PathItem currentPathItem = null; + + foreach (ODataPathSegment segment in _pathSegments) + { + if (segment is EntitySetSegment || segment is NavigationPropertySegment) + { + pathItems.Add(new PathItem()); + currentPathItem = pathItems.Last(); + currentPathItem.Name = segment.Identifier; + } + else if(segment is TypeSegment) + { + currentPathItem.IsCastType = true; + currentPathItem.CastTypeName = segment.Identifier; + } + else if (segment is KeySegment keySegment) + { + currentPathItem.KeyProperties = new Dictionary(); + + foreach(KeyValuePair key in keySegment.Keys) + { + currentPathItem.KeyProperties.Add(key.Key, key.Value); + } + } + + } + + return pathItems.ToArray(); + } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/NavigationPropertyQueryableConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/NavigationPropertyQueryableConfiguration.cs index dfdc4087e2..c932e998ad 100644 --- a/src/Microsoft.AspNet.OData.Shared/NavigationPropertyQueryableConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/NavigationPropertyQueryableConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; diff --git a/src/Microsoft.AspNet.OData.Shared/NavigationPropertyQueryableConfigurationAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/NavigationPropertyQueryableConfigurationAnnotation.cs index 22086717cb..7b49d86aa3 100644 --- a/src/Microsoft.AspNet.OData.Shared/NavigationPropertyQueryableConfigurationAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/NavigationPropertyQueryableConfigurationAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData { diff --git a/src/Microsoft.AspNet.OData.Shared/NonValidatingParameterBindingAttribute.cs b/src/Microsoft.AspNet.OData.Shared/NonValidatingParameterBindingAttribute.cs index 5e850be060..db5c851af7 100644 --- a/src/Microsoft.AspNet.OData.Shared/NonValidatingParameterBindingAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/NonValidatingParameterBindingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData { diff --git a/src/Microsoft.AspNet.OData.Shared/NullEdmComplexObject.cs b/src/Microsoft.AspNet.OData.Shared/NullEdmComplexObject.cs index e864bb0d96..4e5102caad 100644 --- a/src/Microsoft.AspNet.OData.Shared/NullEdmComplexObject.cs +++ b/src/Microsoft.AspNet.OData.Shared/NullEdmComplexObject.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/ODataAPIHandler.cs b/src/Microsoft.AspNet.OData.Shared/ODataAPIHandler.cs new file mode 100644 index 0000000000..739c568969 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/ODataAPIHandler.cs @@ -0,0 +1,50 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; + +namespace Microsoft.AspNet.OData +{ + /// + /// Handler Class to handle users methods for create, delete and update. + /// This is the handler for data modification where there is a CLR type. + /// + public abstract class ODataAPIHandler: IODataAPIHandler where TStructuralType : class + { + /// + /// TryCreate method to create a new object. + /// + /// TheKey value pair of the objecct to be created. Optional + /// The created object (CLR or Typeless) + /// Any error message in case of an exception + /// The status of the TryCreate method + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#")] + [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#")] + public abstract ODataAPIResponseStatus TryCreate(IDictionary keyValues, out TStructuralType createdObject, out string errorMessage); + + /// + /// TryGet method which tries to get the Origignal object based on a keyvalues. + /// + /// Key value pair for the entity keys + /// Object to return + /// Any error message in case of an exception + /// The status of the TryGet method + public abstract ODataAPIResponseStatus TryGet(IDictionary keyValues, out TStructuralType originalObject, out string errorMessage); + + /// + /// TryDelete Method which will delete the object based on keyvalue pairs. + /// + /// + /// + /// The status of the TryGet method + public abstract ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage); + + /// + /// Get the ODataAPIHandler for the nested type + /// + /// Parent instance. + /// The name of the navigation property for the handler + /// The type of Nested ODataAPIHandler + public abstract IODataAPIHandler GetNestedHandler(TStructuralType parent, string navigationPropertyName); + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/ODataAPIHandlerFactory.cs b/src/Microsoft.AspNet.OData.Shared/ODataAPIHandlerFactory.cs new file mode 100644 index 0000000000..507536ba34 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/ODataAPIHandlerFactory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +namespace Microsoft.AspNet.OData +{ + /// + /// Factory class for ODataAPIHandlers + /// + public abstract class ODataAPIHandlerFactory + { + /// + /// Get the handler depending on navigationpath + /// + /// Navigation path corresponding to an odataid + /// + public abstract IODataAPIHandler GetHandler(NavigationPath navigationPath); + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/ODataAPIResponseStatus.cs b/src/Microsoft.AspNet.OData.Shared/ODataAPIResponseStatus.cs new file mode 100644 index 0000000000..5b24274d38 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/ODataAPIResponseStatus.cs @@ -0,0 +1,24 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +namespace Microsoft.AspNet.OData +{ + /// + /// Enum for Patch Status + /// + public enum ODataAPIResponseStatus + { + /// + /// Success Status + /// + Success, + /// + /// Failure Status + /// + Failure, + /// + /// Resource Not Found + /// + NotFound + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/ODataActionParameters.cs b/src/Microsoft.AspNet.OData.Shared/ODataActionParameters.cs index 0a082fa4bf..2e2d5048b3 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataActionParameters.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataActionParameters.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; @@ -16,4 +20,4 @@ namespace Microsoft.AspNet.OData public class ODataActionParameters : Dictionary { } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/ODataController.cs b/src/Microsoft.AspNet.OData.Shared/ODataController.cs index 02132e9bc7..1ce305c9f2 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataController.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData { diff --git a/src/Microsoft.AspNet.OData.Shared/ODataEdmAPIHandlerFactory.cs b/src/Microsoft.AspNet.OData.Shared/ODataEdmAPIHandlerFactory.cs new file mode 100644 index 0000000000..1a772d192a --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/ODataEdmAPIHandlerFactory.cs @@ -0,0 +1,18 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +namespace Microsoft.AspNet.OData +{ + /// + /// Factory class for ODataAPIHandlers for typeless entities + /// + public abstract class ODataEdmAPIHandlerFactory + { + /// + /// Get the handler depending on navigationpath + /// + /// Navigation path corresponding to an odataid + /// + public abstract EdmODataAPIHandler GetHandler(NavigationPath navigationPath); + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/ODataIdContainer.cs b/src/Microsoft.AspNet.OData.Shared/ODataIdContainer.cs new file mode 100644 index 0000000000..75f397cb9f --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/ODataIdContainer.cs @@ -0,0 +1,16 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +namespace Microsoft.AspNet.OData +{ + /// + /// Sealed class to hold ODataID in parsed format, it will be used by POCO objects as well as Delta{TStructuralType} + /// + public sealed class ODataIdContainer + { + /// + /// The Navigation path corresponding to the ODataId + /// + public NavigationPath ODataIdNavigationPath { set; get; } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/ODataNullValueMessageHandler.cs b/src/Microsoft.AspNet.OData.Shared/ODataNullValueMessageHandler.cs index a60d571dc3..561f00e574 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataNullValueMessageHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataNullValueMessageHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.ObjectModel; using System.Net; diff --git a/src/Microsoft.AspNet.OData.Shared/ODataQueryContext.cs b/src/Microsoft.AspNet.OData.Shared/ODataQueryContext.cs index e383f1691c..a34aacfee2 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataQueryContext.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataQueryContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/ODataQueryContextExtensions.cs b/src/Microsoft.AspNet.OData.Shared/ODataQueryContextExtensions.cs index 04f1e8f73a..9914221ec2 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataQueryContextExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataQueryContextExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Query; @@ -48,4 +52,4 @@ public static SkipTokenQueryValidator GetSkipTokenQueryValidator(this ODataQuery return context.RequestContainer.GetRequiredService(); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/ODataQueryParameterBindingAttribute.cs b/src/Microsoft.AspNet.OData.Shared/ODataQueryParameterBindingAttribute.cs index 3aa5cfd598..b538ceaa58 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataQueryParameterBindingAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataQueryParameterBindingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/ODataSwaggerConverter.cs b/src/Microsoft.AspNet.OData.Shared/ODataSwaggerConverter.cs index b345c68177..f6c18fbb1a 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataSwaggerConverter.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataSwaggerConverter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/ODataSwaggerUtilities.cs b/src/Microsoft.AspNet.OData.Shared/ODataSwaggerUtilities.cs index 07f33e0a83..d91f075292 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataSwaggerUtilities.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataSwaggerUtilities.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/ODataUntypedActionParameters.cs b/src/Microsoft.AspNet.OData.Shared/ODataUntypedActionParameters.cs index f64f15736e..599d4b8e94 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataUntypedActionParameters.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataUntypedActionParameters.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/ODataUriFunctions.cs b/src/Microsoft.AspNet.OData.Shared/ODataUriFunctions.cs index a7f599fe5a..77ab54d2b3 100644 --- a/src/Microsoft.AspNet.OData.Shared/ODataUriFunctions.cs +++ b/src/Microsoft.AspNet.OData.Shared/ODataUriFunctions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/PageResult.cs b/src/Microsoft.AspNet.OData.Shared/PageResult.cs index 409d5e1ba2..b3233471b9 100644 --- a/src/Microsoft.AspNet.OData.Shared/PageResult.cs +++ b/src/Microsoft.AspNet.OData.Shared/PageResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Runtime.Serialization; diff --git a/src/Microsoft.AspNet.OData.Shared/PageResultOfT.cs b/src/Microsoft.AspNet.OData.Shared/PageResultOfT.cs index 5f1e87d594..d19b7147f1 100644 --- a/src/Microsoft.AspNet.OData.Shared/PageResultOfT.cs +++ b/src/Microsoft.AspNet.OData.Shared/PageResultOfT.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -65,4 +69,4 @@ IEnumerator IEnumerable.GetEnumerator() return Items.GetEnumerator(); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/PathItem.cs b/src/Microsoft.AspNet.OData.Shared/PathItem.cs new file mode 100644 index 0000000000..aa47fcf535 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/PathItem.cs @@ -0,0 +1,33 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; + +namespace Microsoft.AspNet.OData +{ + /// + /// Class to hold the PathItem Name and its keyproperties + /// + public class PathItem + { + /// + /// Name of the Path Item (eg: entity name, entity set name) + /// + public string Name { internal set; get; } + + /// + /// Whether the PathItem is a cast segment + /// + public bool IsCastType { internal set; get; } + + /// + /// If the item is a cast segment, Name of the Path Item (eg: derived entity name, entity set name) + /// + public string CastTypeName { internal set; get; } + + /// + /// List of Key properties of that entity + /// + public Dictionary KeyProperties { internal set; get; } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/PerRouteContainerBase.cs b/src/Microsoft.AspNet.OData.Shared/PerRouteContainerBase.cs index bfc9bf855a..2b5bbee9b7 100644 --- a/src/Microsoft.AspNet.OData.Shared/PerRouteContainerBase.cs +++ b/src/Microsoft.AspNet.OData.Shared/PerRouteContainerBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/PropertyAccessor.cs b/src/Microsoft.AspNet.OData.Shared/PropertyAccessor.cs index 0d73a5826e..8b6ea43385 100644 --- a/src/Microsoft.AspNet.OData.Shared/PropertyAccessor.cs +++ b/src/Microsoft.AspNet.OData.Shared/PropertyAccessor.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/AllowedArithmeticOperators.cs b/src/Microsoft.AspNet.OData.Shared/Query/AllowedArithmeticOperators.cs index c0aecc2512..d2f26d0222 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/AllowedArithmeticOperators.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/AllowedArithmeticOperators.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/AllowedFunctions.cs b/src/Microsoft.AspNet.OData.Shared/Query/AllowedFunctions.cs index 1e17858acd..477036c517 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/AllowedFunctions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/AllowedFunctions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -166,4 +170,4 @@ public enum AllowedFunctions /// AllFunctions = AllStringFunctions | AllDateTimeFunctions | AllMathFunctions | Cast | IsOf | Any | All } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/AllowedLogicalOperators.cs b/src/Microsoft.AspNet.OData.Shared/Query/AllowedLogicalOperators.cs index 44c19fba8f..860c22ef50 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/AllowedLogicalOperators.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/AllowedLogicalOperators.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/AllowedQueryOptions.cs b/src/Microsoft.AspNet.OData.Shared/Query/AllowedQueryOptions.cs index d17e22b202..32cd847633 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/AllowedQueryOptions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/AllowedQueryOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ApplyQueryOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/ApplyQueryOption.cs index c63920c785..a65a817fb9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ApplyQueryOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ApplyQueryOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/CountAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/CountAttribute.cs index 8330280384..91a83d5141 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/CountAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/CountAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/CountQueryOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/CountQueryOption.cs index a2ce501a7c..401306f3a6 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/CountQueryOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/CountQueryOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/DefaultQuerySettings.cs b/src/Microsoft.AspNet.OData.Shared/Query/DefaultQuerySettings.cs index 67685a2826..89c57cb0f7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/DefaultQuerySettings.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/DefaultQuerySettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/DefaultSkipTokenHandler.cs b/src/Microsoft.AspNet.OData.Shared/Query/DefaultSkipTokenHandler.cs index 3042610b49..c626748b8d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/DefaultSkipTokenHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/DefaultSkipTokenHandler.cs @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + using System; using System.Collections.Generic; using System.Diagnostics; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ExpandAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/ExpandAttribute.cs index 94195e181d..8e521d141f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ExpandAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ExpandAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ExpandConfiguration.cs b/src/Microsoft.AspNet.OData.Shared/Query/ExpandConfiguration.cs index 3ea1dae5be..b6c457774b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ExpandConfiguration.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ExpandConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Query { diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/AggregationBinder.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/AggregationBinder.cs index 8498cf2b7d..5a0d86cdb1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/AggregationBinder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/AggregationBinder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/AggregationPropertyContainer.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/AggregationPropertyContainer.cs index d34f990eb4..db85d6a4cb 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/AggregationPropertyContainer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/AggregationPropertyContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ClrCanonicalFunctions.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ClrCanonicalFunctions.cs index bbd1fd5cee..e3bf6cc945 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ClrCanonicalFunctions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ClrCanonicalFunctions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ClrSafeFunctions.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ClrSafeFunctions.cs index b7e30c5ce0..38c2545a51 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ClrSafeFunctions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ClrSafeFunctions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ComputeBinder.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ComputeBinder.cs index 588b584568..5284075759 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ComputeBinder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ComputeBinder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/DynamicTypeWrapper.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/DynamicTypeWrapper.cs index f9ab8c295a..ac1944191d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/DynamicTypeWrapper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/DynamicTypeWrapper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/DynamicTypeWrapperConverter.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/DynamicTypeWrapperConverter.cs index 6bf0bdc674..52fbd887d2 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/DynamicTypeWrapperConverter.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/DynamicTypeWrapperConverter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ExpressionBinderBase.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ExpressionBinderBase.cs index 47245a6fe1..698ccfa8c2 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ExpressionBinderBase.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ExpressionBinderBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -42,7 +46,9 @@ public abstract class ExpressionBinderBase internal static readonly Expression ZeroConstant = Expression.Constant(0); internal static readonly MethodInfo EnumTryParseMethod = typeof(Enum).GetMethods() - .Single(m => m.Name == "TryParse" && m.GetParameters().Length == 2); + .Single(m => m.Name.Equals("TryParse", StringComparison.Ordinal) + && m.GetParameters().Length == 2 + && m.GetParameters()[0].ParameterType.Equals(typeof(string))); internal static readonly Dictionary BinaryOperatorMapping = new Dictionary { @@ -134,11 +140,11 @@ internal Expression CreateBinaryExpression(BinaryOperatorKind binaryOperator, Ex if (leftUnderlyingType == typeof(DateTime) && rightUnderlyingType == typeof(DateTimeOffset)) { - right = DateTimeOffsetToDateTime(right); + right = DateTimeOffsetToDateTime(right, QuerySettings.EnableConstantParameterization); } else if (rightUnderlyingType == typeof(DateTime) && leftUnderlyingType == typeof(DateTimeOffset)) { - left = DateTimeOffsetToDateTime(left); + left = DateTimeOffsetToDateTime(left, QuerySettings.EnableConstantParameterization); } if ((IsDateOrOffset(leftUnderlyingType) && IsDate(rightUnderlyingType)) || @@ -972,7 +978,7 @@ internal static object ExtractParameterizedConstant(Expression expression) return null; } - internal static Expression DateTimeOffsetToDateTime(Expression expression) + internal static Expression DateTimeOffsetToDateTime(Expression expression, bool EnableConstantParameterization = false) { var unaryExpression = expression as UnaryExpression; if (unaryExpression != null) @@ -985,11 +991,26 @@ internal static Expression DateTimeOffsetToDateTime(Expression expression) } var parameterizedConstantValue = ExtractParameterizedConstant(expression); var dto = parameterizedConstantValue as DateTimeOffset?; - if (dto != null) + object expressionValue; + + if(dto != null) { - expression = Expression.Constant(EdmPrimitiveHelpers.ConvertPrimitiveValue(dto.Value, typeof(DateTime))); + expressionValue = dto.Value; + } + else + { + expressionValue = (expression as ConstantExpression).Value; + } + + object value = EdmPrimitiveHelpers.ConvertPrimitiveValue(expressionValue, typeof(DateTime)); + if (EnableConstantParameterization) + { + return LinqParameterContainer.Parameterize(typeof(DateTime), value); + } + else + { + return Expression.Constant(value, typeof(DateTime)); } - return expression; } internal static bool IsNullable(Type t) diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/FilterBinder.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/FilterBinder.cs index 4f808253ac..ec7d278dde 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/FilterBinder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/FilterBinder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -224,7 +228,31 @@ private Expression BindCountNode(CountNode node) countMethod = ExpressionHelperMethods.EnumerableCountGeneric.MakeGenericMethod(elementType); } - // call Count() method. + MethodInfo whereMethod; + if (typeof(IQueryable).IsAssignableFrom(source.Type)) + { + whereMethod = ExpressionHelperMethods.QueryableWhereGeneric.MakeGenericMethod(elementType); + } + else + { + whereMethod = ExpressionHelperMethods.EnumerableWhereGeneric.MakeGenericMethod(elementType); + } + + // Bind the inner $filter clause within the $count segment. + // e.g Books?$filter=Authors/$count($filter=Id gt 1) gt 1 + Expression filterExpression = null; + if (node.FilterClause != null) + { + filterExpression = BindFilterClause(this, node.FilterClause, elementType); + + // The source expression looks like: $it.Authors + // So the generated source expression below will look like: $it.Authors.Where($it => $it.Id > 1) + source = Expression.Call(null, whereMethod, new[] { source, filterExpression }); + } + + // append LongCount() method. + // The final countExpression with the nested $filter clause will look like: $it.Authors.Where($it => $it.Id > 1).LongCount() + // The final countExpression without the nested $filter clause will look like: $it.Authors.LongCount() countExpression = Expression.Call(null, countMethod, new[] { source }); if (QuerySettings.HandleNullPropagation == HandleNullPropagationOption.True) @@ -916,7 +944,9 @@ private ParameterExpression HandleLambdaParameters(IEnumerable ra foreach (RangeVariable rangeVariable in rangeVariables) { ParameterExpression parameter; - if (!_lambdaParameters.TryGetValue(rangeVariable.Name, out parameter)) + + // Create a Parameter Expression for rangeVariables which are not $it Lambda parameters or $this. + if (!_lambdaParameters.TryGetValue(rangeVariable.Name, out parameter) && rangeVariable.Name != ODataThisParameterName) { // Work-around issue 481323 where UriParser yields a collection parameter type // for primitive collections rather than the inner element type of the collection. diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/IdentityPropertyMapper.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/IdentityPropertyMapper.cs index e9613912f8..03d663f334 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/IdentityPropertyMapper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/IdentityPropertyMapper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Query.Expressions { diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/Linq2ObjectsComparisonMethods.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/Linq2ObjectsComparisonMethods.cs index d63417ef73..f8e3fbbce5 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/Linq2ObjectsComparisonMethods.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/Linq2ObjectsComparisonMethods.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/LinqParameterContainer.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/LinqParameterContainer.cs index cf63f9be96..5e89985375 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/LinqParameterContainer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/LinqParameterContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Concurrent; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ModelContainer.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ModelContainer.cs index 6d90862071..c36a8e8b15 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ModelContainer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/ModelContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Concurrent; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/NamedPropertyExpression.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/NamedPropertyExpression.cs index 13190d0722..3742a2b0ca 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/NamedPropertyExpression.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/NamedPropertyExpression.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; using System.Linq.Expressions; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/PropertyContainer.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/PropertyContainer.cs index 38b983ae9d..27af923a8e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/PropertyContainer.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/PropertyContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/PropertyContainer.generated.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/PropertyContainer.generated.cs index 4faea28655..fd725ecd50 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/PropertyContainer.generated.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/PropertyContainer.generated.cs @@ -1,4 +1,11 @@ -// +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +// // This code was generated by a tool (PropertyContainer.generated.tt). // Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. @@ -1567,4 +1574,4 @@ public override void ToDictionaryCore(Dictionary dictionary, IPr }; } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandBinder.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandBinder.cs index ae8a3bae8f..1e83b186e5 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandBinder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandBinder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandIncludedProperty.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandIncludedProperty.cs index 054b9c9213..3570f4df56 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandIncludedProperty.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandIncludedProperty.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandPathExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandPathExtensions.cs index 6f47c916bd..4147ee8195 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandPathExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandPathExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapper.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapper.cs index bfabc93021..62b2898a96 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapperConverter.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapperConverter.cs index 355754a222..a93fffce06 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapperConverter.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapperConverter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapperOfT.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapperOfT.cs index a12fe90dbb..d06afd4d55 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapperOfT.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/SelectExpandWrapperOfT.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Newtonsoft.Json; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/TransformationBinderBase.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/TransformationBinderBase.cs index 19644c65b1..c5dda6175a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/TransformationBinderBase.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/TransformationBinderBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/UriFunctionsBinder.cs b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/UriFunctionsBinder.cs index d2674c696d..1d45e81c89 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Expressions/UriFunctionsBinder.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Expressions/UriFunctionsBinder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/FilterAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/FilterAttribute.cs index 838e336a93..9418a7654d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/FilterAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/FilterAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/FilterQueryOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/FilterQueryOption.cs index a7e1fd5f38..e2df123b8c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/FilterQueryOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/FilterQueryOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/HandleNullPropagationOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/HandleNullPropagationOption.cs index 26a41cad36..d9622e15aa 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/HandleNullPropagationOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/HandleNullPropagationOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Query { @@ -25,4 +29,4 @@ public enum HandleNullPropagationOption /// False = 2 } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/HandleNullPropagationOptionHelper.cs b/src/Microsoft.AspNet.OData.Shared/Query/HandleNullPropagationOptionHelper.cs index 505176f48f..245efc6091 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/HandleNullPropagationOptionHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/HandleNullPropagationOptionHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; using System.Linq; @@ -109,4 +113,4 @@ internal enum DataSourceProviderKind /// EFCore, } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ICountOptionCollection.cs b/src/Microsoft.AspNet.OData.Shared/Query/ICountOptionCollection.cs index 30e3267bad..36dea60a13 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ICountOptionCollection.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ICountOptionCollection.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/IODataQueryOptionsParser.cs b/src/Microsoft.AspNet.OData.Shared/Query/IODataQueryOptionsParser.cs index f5da4aefc5..b8e7ce4555 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/IODataQueryOptionsParser.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/IODataQueryOptionsParser.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.IO; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/IPropertyMapper.cs b/src/Microsoft.AspNet.OData.Shared/Query/IPropertyMapper.cs index ba665064a3..58c9e74e96 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/IPropertyMapper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/IPropertyMapper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ISelectExpandWrapper.cs b/src/Microsoft.AspNet.OData.Shared/Query/ISelectExpandWrapper.cs index 33e5cfe333..e89c4049ec 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ISelectExpandWrapper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ISelectExpandWrapper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ITruncatedCollection.cs b/src/Microsoft.AspNet.OData.Shared/Query/ITruncatedCollection.cs index a40f4e3084..7edcf2a941 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ITruncatedCollection.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ITruncatedCollection.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ModelBoundQuerySettings.cs b/src/Microsoft.AspNet.OData.Shared/Query/ModelBoundQuerySettings.cs index b3cce60858..f1879c0e2c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ModelBoundQuerySettings.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ModelBoundQuerySettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/NonFilterableAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/NonFilterableAttribute.cs index a0fc52fb33..58dfa65234 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/NonFilterableAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/NonFilterableAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/NotCountableAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/NotCountableAttribute.cs index e8c4df9916..818a126c12 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/NotCountableAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/NotCountableAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -13,4 +17,4 @@ namespace Microsoft.AspNet.OData.Query public sealed class NotCountableAttribute : Attribute { } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/NotExpandableAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/NotExpandableAttribute.cs index c2bf0559c9..59638ef3be 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/NotExpandableAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/NotExpandableAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/NotFilterableAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/NotFilterableAttribute.cs index bb56547472..a1a3e57127 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/NotFilterableAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/NotFilterableAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -13,4 +17,4 @@ namespace Microsoft.AspNet.OData.Query public sealed class NotFilterableAttribute : Attribute { } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/NotNavigableAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/NotNavigableAttribute.cs index 1f0534be32..843938a253 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/NotNavigableAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/NotNavigableAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/NotSortableAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/NotSortableAttribute.cs index ad915c4fb8..b84d689d18 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/NotSortableAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/NotSortableAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -13,4 +17,4 @@ namespace Microsoft.AspNet.OData.Query public sealed class NotSortableAttribute : Attribute { } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ODataPathQueryBuilder.cs b/src/Microsoft.AspNet.OData.Shared/Query/ODataPathQueryBuilder.cs new file mode 100644 index 0000000000..13b8aa860c --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/Query/ODataPathQueryBuilder.cs @@ -0,0 +1,213 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using System.Linq.Expressions; +using System.Reflection; +using Microsoft.OData.Edm; +using Microsoft.OData.UriParser; + +namespace Microsoft.AspNet.OData.Query +{ + + /// + /// This class transforms an based on + /// the key and property accesses in the segments of an + /// + internal class ODataPathQueryBuilder + { + private readonly IQueryable source; + private readonly Routing.ODataPath path; + + /// + /// Creates an instance of + /// + /// The original to be transformed + /// The based on which to transform the + public ODataPathQueryBuilder(IQueryable source, Routing.ODataPath path) + { + this.source = source; + this.path = path; + } + + /// + /// Transforms the source based on the sequence of path segments in the + /// + /// The result of the query transformtions or null if the path contained unsupported segments + public ODataPathQueryResult BuildQuery() + { + ODataPathQueryResult result = new ODataPathQueryResult(); + + IEnumerable segments = path.Segments; + + IQueryable queryable = source; + + ODataPathSegment firstSegment = segments.FirstOrDefault(); + + if (!(firstSegment is EntitySetSegment || firstSegment is SingletonSegment)) + { + return null; + } + + IEnumerable remainingSegments = segments.Skip(1); + + foreach (ODataPathSegment segment in remainingSegments) + { + if (segment is KeySegment keySegment) + { + // The following block is equivalent to: + // filterPredicate = entity => (entity.KeyProp1 == Val1) && (entity.keyProp2 == Val2) && ... + ParameterExpression filterParam = Expression.Parameter(queryable.ElementType, "entity"); + IEnumerable conditions = keySegment.Keys.Select(kvp => + Expression.Equal( + Expression.Property(filterParam, kvp.Key), + Expression.Constant(kvp.Value))); + BinaryExpression filterBody = conditions.Aggregate((left, right) => Expression.AndAlso(left, right)); + LambdaExpression filterPredicate = Expression.Lambda(filterBody, filterParam); + + // The following statement is equivalent to: + // queryable = queryable.Where(entity => (entity.KeyProp1 == Val1) && (entity.KeyProp2 == Val2) ...) + queryable = ExpressionHelpers.Where(queryable, filterPredicate, queryable.ElementType); + + } + else if (segment is NavigationPropertySegment navigationSegment) + { + string propertyName = navigationSegment.NavigationProperty.Name; + + if (navigationSegment.NavigationProperty.TargetMultiplicity() == EdmMultiplicity.Many) + { + queryable = GetCollectionPropertyQuery(queryable, propertyName); + } + else + { + queryable = GetSinglePropertyQuery(queryable, propertyName, checkIfNull: true); + } + } + else if (segment is PropertySegment propertySegment) + { + string propertyName = propertySegment.Property.Name; + + if (propertySegment.Property.Type.IsCollection()) + { + queryable = GetCollectionPropertyQuery(queryable, propertyName); + } + else + { + // we don't check whether param.Property is null because + // comparisons on complex properties cause errors in EF + queryable = GetSinglePropertyQuery(queryable, propertyName, checkIfNull: false); + } + } + else if (segment is CountSegment) + { + result.HasCountSegment = true; + } + else if (segment is ValueSegment) + { + result.HasValueSegment = true; + } + else + { + // reached unsupported segment + return null; + } + } + + result.Result = queryable; + + return result; + } + + /// + /// Transforms by selecting + /// the single-valued property of called . + /// + /// The to apply the property selection to + /// The name of the single-valued property to select + /// If true, checks whether the property is null before selecting it + /// The transformed + private static IQueryable GetSinglePropertyQuery(IQueryable queryable, string propertyName, bool checkIfNull = false) + { + ParameterExpression param = Expression.Parameter(queryable.ElementType); + MemberExpression propertyExpression = Expression.Property(param, propertyName); + IQueryable result = queryable; + + if (checkIfNull) + { + // queryable = queryable.Where(entity => entity.Property != null) + BinaryExpression condition = Expression.NotEqual(propertyExpression, Expression.Constant(null)); + LambdaExpression nullFilter = Expression.Lambda(condition, param); + result = ExpressionHelpers.Where(queryable, nullFilter, queryable.ElementType); + } + + // return queryable.Select(entity => entity.NavProp) + LambdaExpression selectBody = + Expression.Lambda(propertyExpression, param); + return ExpressionHelpers.Select(result, selectBody, queryable.ElementType); + } + + /// + /// Transforms by selecting + /// the collection-valued property called . + /// + /// The to apply the property selection to + /// The name of the collection-valued property to select + /// The transformed + private static IQueryable GetCollectionPropertyQuery(IQueryable queryable, string propertyName) + { + ParameterExpression param = Expression.Parameter(queryable.ElementType); + MemberExpression propertyExpression = Expression.Property(param, propertyName); + + // for collection properties we use SelectMany instead of Select + // because Select would return an IQueryable>, + // but SelectMany flattens it to IQueryable + + // we don't check whether the property is null before advancing + // because that seems to cause exceptions in EF + + // We expect the collection navigation property to implements IEnumerable + // Here we extract the element type T + Type collectionPropertyElementType = TypeHelper.GetImplementedIEnumerableType(propertyExpression.Type) ?? propertyExpression.Type; + + // The lambda passed to queryable.SelectMany() has a signature Func> + // TSource corresponds to our queryable.ElementType and TResult is the element type of the nav property + Type delegateType = typeof(Func<,>).MakeGenericType( + queryable.ElementType, + typeof(IEnumerable<>).MakeGenericType(collectionPropertyElementType)); + LambdaExpression selectBody = + Expression.Lambda(delegateType, propertyExpression, param); + + // return queryable.SelectMany(entity => entity.CollectionNavProp) + return ExpressionHelpers + .SelectMany(queryable, selectBody, queryable.ElementType, collectionPropertyElementType); + } + } + + /// + /// Result returned by after + /// applying transformations based on path. + /// + internal class ODataPathQueryResult + { + /// + /// The result of the query transformations applied to the original + /// by the + /// + public IQueryable Result { get; set; } + /// + /// Whether the path has a $count segment + /// + public bool HasCountSegment { get; set; } + /// + /// Whether the path has a $value segment + /// + public bool HasValueSegment { get; set; } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptions.cs b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptions.cs index 13da5b7cfb..29d53cc8e5 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsOfTEntity.cs b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsOfTEntity.cs index 57b2fa5440..4e6a7eb1a4 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsOfTEntity.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsOfTEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http.Headers; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsParserFactory.cs b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsParserFactory.cs index b65c55e20c..3c523d2bef 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsParserFactory.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ODataQueryOptionsParserFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ODataQuerySettings.cs b/src/Microsoft.AspNet.OData.Shared/Query/ODataQuerySettings.cs index 7dd54179b8..032ba3a097 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ODataQuerySettings.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ODataQuerySettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ODataRawQueryOptions.cs b/src/Microsoft.AspNet.OData.Shared/Query/ODataRawQueryOptions.cs index ac643c3391..1987d07dd2 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ODataRawQueryOptions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ODataRawQueryOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Query { diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ODataValidationSettings.cs b/src/Microsoft.AspNet.OData.Shared/Query/ODataValidationSettings.cs index 50b8090e85..f22212c896 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ODataValidationSettings.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ODataValidationSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.ObjectModel; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/OrderByAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/OrderByAttribute.cs index ac64441de6..546b6c26ec 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/OrderByAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/OrderByAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/OrderByCountNode.cs b/src/Microsoft.AspNet.OData.Shared/Query/OrderByCountNode.cs index b1782f60d5..f906ba9ea7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/OrderByCountNode.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/OrderByCountNode.cs @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; using Microsoft.OData.UriParser; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/OrderByItNode.cs b/src/Microsoft.AspNet.OData.Shared/Query/OrderByItNode.cs index c8b1255227..1cfdedd66e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/OrderByItNode.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/OrderByItNode.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.UriParser; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/OrderByNode.cs b/src/Microsoft.AspNet.OData.Shared/Query/OrderByNode.cs index 6b4f72c179..f6bb22ec63 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/OrderByNode.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/OrderByNode.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/OrderByOpenPropertyNode.cs b/src/Microsoft.AspNet.OData.Shared/Query/OrderByOpenPropertyNode.cs index a8c5c89f9b..c970dfe4bf 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/OrderByOpenPropertyNode.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/OrderByOpenPropertyNode.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData; @@ -45,4 +49,4 @@ public OrderByOpenPropertyNode(OrderByClause orderByClause) /// public string PropertyName { get; private set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/OrderByPropertyNode.cs b/src/Microsoft.AspNet.OData.Shared/Query/OrderByPropertyNode.cs index 9865510bd8..6de79ed469 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/OrderByPropertyNode.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/OrderByPropertyNode.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/OrderByQueryOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/OrderByQueryOption.cs index e5b8ba1b3c..cbfa57ba30 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/OrderByQueryOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/OrderByQueryOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/PageAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/PageAttribute.cs index fcda5924ee..834abb4081 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/PageAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/PageAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/ParameterAliasNodeTranslator.cs b/src/Microsoft.AspNet.OData.Shared/Query/ParameterAliasNodeTranslator.cs index bce7431a23..d05706d666 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/ParameterAliasNodeTranslator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/ParameterAliasNodeTranslator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -398,7 +402,7 @@ public override QueryNode Visit(UnaryOperatorNode nodeIn) /// The translated node. public override QueryNode Visit(CountNode nodeIn) { - return new CountNode((CollectionNode)nodeIn.Source.Accept(this)); + return new CountNode((CollectionNode)nodeIn.Source.Accept(this), nodeIn.FilterClause, nodeIn.SearchClause); } } } diff --git a/src/Microsoft.AspNet.OData.Shared/Query/PlainTextODataQueryOptionsParser.cs b/src/Microsoft.AspNet.OData.Shared/Query/PlainTextODataQueryOptionsParser.cs index 159e3c44fb..07d11bb364 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/PlainTextODataQueryOptionsParser.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/PlainTextODataQueryOptionsParser.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.IO; using System.Net.Http.Headers; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/QueryOptionSetting.cs b/src/Microsoft.AspNet.OData.Shared/Query/QueryOptionSetting.cs index bf51fc117e..179f98b4c4 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/QueryOptionSetting.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/QueryOptionSetting.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Query { diff --git a/src/Microsoft.AspNet.OData.Shared/Query/SelectAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/SelectAttribute.cs index dbc4f4c3ef..a15fcbcde9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/SelectAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/SelectAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/SelectExpandQueryOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/SelectExpandQueryOption.cs index b380eb8bc3..030883cc2f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/SelectExpandQueryOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/SelectExpandQueryOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/SelectExpandType.cs b/src/Microsoft.AspNet.OData.Shared/Query/SelectExpandType.cs index 845f5e43fe..d3f3c8b611 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/SelectExpandType.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/SelectExpandType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Query { diff --git a/src/Microsoft.AspNet.OData.Shared/Query/SkipQueryOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/SkipQueryOption.cs index 8372ccf537..1534d6ec6f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/SkipQueryOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/SkipQueryOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenHandler.cs b/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenHandler.cs index cf4254f697..c68f5d1d7f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -38,4 +42,4 @@ public abstract class SkipTokenHandler /// URI for the NextPageLink. public abstract Uri GenerateNextPageLink(Uri baseUri, int pageSize, Object instance, ODataSerializerContext context); } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenQueryOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenQueryOption.cs index cd08e2c96c..ac3898615b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenQueryOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/SkipTokenQueryOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -121,4 +125,4 @@ public void Validate(ODataValidationSettings validationSettings) } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/TopQueryOption.cs b/src/Microsoft.AspNet.OData.Shared/Query/TopQueryOption.cs index a480dfab37..a91ac9ac21 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/TopQueryOption.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/TopQueryOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/TruncatedCollectionOfT.cs b/src/Microsoft.AspNet.OData.Shared/Query/TruncatedCollectionOfT.cs index c0e1041091..73dbc3c243 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/TruncatedCollectionOfT.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/TruncatedCollectionOfT.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/UnsortableAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Query/UnsortableAttribute.cs index 0e81ed20db..3ab1389fc3 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/UnsortableAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/UnsortableAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/CountQueryValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/CountQueryValidator.cs index cf2fd073da..e5ecefcd56 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/CountQueryValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/CountQueryValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; @@ -84,4 +88,4 @@ internal static CountQueryValidator GetCountQueryValidator(ODataQueryContext con : context.RequestContainer.GetRequiredService(); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/FilterQueryValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/FilterQueryValidator.cs index d71725614e..2732f897fa 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/FilterQueryValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/FilterQueryValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using System.Diagnostics.Contracts; @@ -332,6 +336,36 @@ public virtual void ValidateConvertNode(ConvertNode convertNode, ODataValidation ValidateQueryNode(convertNode.Source, settings); } + /// + /// Override this method to restrict the '$count' inside the filter query. + /// + /// + /// + public virtual void ValidateCountNode(CountNode countNode, ODataValidationSettings settings) + { + if (countNode == null) + { + throw Error.ArgumentNull("countNode"); + } + + if (settings == null) + { + throw Error.ArgumentNull("settings"); + } + + ValidateQueryNode(countNode.Source, settings); + + if (countNode.FilterClause != null) + { + ValidateQueryNode(countNode.FilterClause.Expression, settings); + } + + if (countNode.SearchClause != null) + { + ValidateQueryNode(countNode.SearchClause.Expression, settings); + } + } + /// /// Override this method for the navigation property node. /// @@ -782,6 +816,10 @@ private void ValidateSingleValueNode(SingleValueNode node, ODataValidationSettin ValidateConvertNode(node as ConvertNode, settings); break; + case QueryNodeKind.Count: + ValidateCountNode(node as CountNode, settings); + break; + case QueryNodeKind.ResourceRangeVariableReference: ValidateRangeVariable((node as ResourceRangeVariableReferenceNode).RangeVariable, settings); break; @@ -1036,4 +1074,4 @@ private static AllowedArithmeticOperators ToArithmeticOperator(BinaryOperatorNod return result; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/ODataQueryValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/ODataQueryValidator.cs index ce907a7388..61d4298146 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/ODataQueryValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/ODataQueryValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.Extensions.DependencyInjection; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/OrderByModelLimitationsValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/OrderByModelLimitationsValidator.cs index ac05bb5488..5a50b27911 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/OrderByModelLimitationsValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/OrderByModelLimitationsValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Formatter; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/OrderByQueryValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/OrderByQueryValidator.cs index d26aca9e48..a554cc92b7 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/OrderByQueryValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/OrderByQueryValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.Extensions.DependencyInjection; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/SelectExpandQueryValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/SelectExpandQueryValidator.cs index 278998e4ae..a0d620955e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/SelectExpandQueryValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/SelectExpandQueryValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/SkipQueryValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/SkipQueryValidator.cs index 6a2c114698..7c213ade7e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/SkipQueryValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/SkipQueryValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.Extensions.DependencyInjection; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/SkipTokenQueryValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/SkipTokenQueryValidator.cs index be8d3db97d..fba21f52f5 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/SkipTokenQueryValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/SkipTokenQueryValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.Extensions.DependencyInjection; diff --git a/src/Microsoft.AspNet.OData.Shared/Query/Validators/TopQueryValidator.cs b/src/Microsoft.AspNet.OData.Shared/Query/Validators/TopQueryValidator.cs index c5c0c64417..2d31fb1ebc 100644 --- a/src/Microsoft.AspNet.OData.Shared/Query/Validators/TopQueryValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Query/Validators/TopQueryValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Formatter; diff --git a/src/Microsoft.AspNet.OData.Shared/QueryHelpers.cs b/src/Microsoft.AspNet.OData.Shared/QueryHelpers.cs new file mode 100644 index 0000000000..b8c5ed724a --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/QueryHelpers.cs @@ -0,0 +1,54 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq; +using Microsoft.AspNet.OData.Common; +using Microsoft.AspNet.OData.Interfaces; + +namespace Microsoft.AspNet.OData.Query +{ + internal static class QueryHelpers + { + /// + /// Get a single or default value from a collection. + /// + /// The response value as . + /// The action context, i.e. action and controller name. + /// + internal static object SingleOrDefault( + IQueryable queryable, + IWebApiActionDescriptor actionDescriptor) + { + var enumerator = queryable.GetEnumerator(); + try + { + var result = enumerator.MoveNext() ? enumerator.Current : null; + + if (enumerator.MoveNext()) + { + throw new InvalidOperationException(Error.Format( + SRResources.SingleResultHasMoreThanOneEntity, + actionDescriptor.ActionName, + actionDescriptor.ControllerName, + "SingleResult")); + } + + return result; + } + finally + { + // Ensure any active/open database objects that were created + // iterating over the IQueryable object are properly closed. + if (enumerator is IDisposable disposable) + { + disposable.Dispose(); + } + } + } + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/QueryableRestrictions.cs b/src/Microsoft.AspNet.OData.Shared/QueryableRestrictions.cs index e35171d2b1..1fd04092ee 100644 --- a/src/Microsoft.AspNet.OData.Shared/QueryableRestrictions.cs +++ b/src/Microsoft.AspNet.OData.Shared/QueryableRestrictions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; diff --git a/src/Microsoft.AspNet.OData.Shared/QueryableRestrictionsAnnotation.cs b/src/Microsoft.AspNet.OData.Shared/QueryableRestrictionsAnnotation.cs index 42a0d4b9e0..392c486ffe 100644 --- a/src/Microsoft.AspNet.OData.Shared/QueryableRestrictionsAnnotation.cs +++ b/src/Microsoft.AspNet.OData.Shared/QueryableRestrictionsAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/RequestMethod.cs b/src/Microsoft.AspNet.OData.Shared/RequestMethod.cs index fc338be489..ddf9afcfa6 100644 --- a/src/Microsoft.AspNet.OData.Shared/RequestMethod.cs +++ b/src/Microsoft.AspNet.OData.Shared/RequestMethod.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData { diff --git a/src/Microsoft.AspNet.OData.Shared/RequestPreferenceHelpers.cs b/src/Microsoft.AspNet.OData.Shared/RequestPreferenceHelpers.cs index f3186fd24b..144ac4d620 100644 --- a/src/Microsoft.AspNet.OData.Shared/RequestPreferenceHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/RequestPreferenceHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/ResourceContext.cs b/src/Microsoft.AspNet.OData.Shared/ResourceContext.cs index bf587f6ab2..529c8287e0 100644 --- a/src/Microsoft.AspNet.OData.Shared/ResourceContext.cs +++ b/src/Microsoft.AspNet.OData.Shared/ResourceContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -191,12 +195,21 @@ public object GetPropertyValue(string propertyName) } object value; + if (SerializerContext.IsDeltaOfT) + { + IDelta delta = ResourceInstance as IDelta; + if (delta != null && delta.TryGetPropertyValue(propertyName, out value)) + { + return value; + } + } + if (EdmObject.TryGetPropertyValue(propertyName, out value)) { return value; } else - { + { IEdmTypeReference edmType = EdmObject.GetEdmType(); if (edmType == null) { diff --git a/src/Microsoft.AspNet.OData.Shared/ResourceContextOfTStructuredType.cs b/src/Microsoft.AspNet.OData.Shared/ResourceContextOfTStructuredType.cs index 6f80d02906..82a3d8d41c 100644 --- a/src/Microsoft.AspNet.OData.Shared/ResourceContextOfTStructuredType.cs +++ b/src/Microsoft.AspNet.OData.Shared/ResourceContextOfTStructuredType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/ResourceSetContext.cs b/src/Microsoft.AspNet.OData.Shared/ResourceSetContext.cs index 4da796164f..e2c0e4f9d8 100644 --- a/src/Microsoft.AspNet.OData.Shared/ResourceSetContext.cs +++ b/src/Microsoft.AspNet.OData.Shared/ResourceSetContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Interfaces; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Results/ResultHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Results/ResultHelpers.cs index 7c3db3aa73..53687fc3ab 100644 --- a/src/Microsoft.AspNet.OData.Shared/Results/ResultHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Results/ResultHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/ActionMapExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/ActionMapExtensions.cs index 4cbea4104e..2fcb2d9d5c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/ActionMapExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/ActionMapExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Interfaces; @@ -23,4 +27,4 @@ public static string FindMatchingAction(this IWebApiActionMap actionMap, params return null; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/ActionRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/ActionRoutingConvention.cs index 784371d938..c4902c78bf 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/ActionRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/ActionRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Interfaces; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/AttributeRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/AttributeRoutingConvention.cs index e65409cf70..4aacdd9718 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/AttributeRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/AttributeRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/DynamicPropertyRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/DynamicPropertyRoutingConvention.cs index bd933d7d30..a8f76ce259 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/DynamicPropertyRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/DynamicPropertyRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; @@ -96,4 +100,4 @@ internal static string SelectActionImpl(ODataPath odataPath, IWebApiControllerCo return null; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/EntityRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/EntityRoutingConvention.cs index 58e8d4cda1..13014736cd 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/EntityRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/EntityRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/EntitySetRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/EntitySetRoutingConvention.cs index c287c506c5..38b775a6a4 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/EntitySetRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/EntitySetRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Interfaces; using Microsoft.OData.Edm; @@ -42,6 +46,13 @@ internal static string SelectActionImpl(ODataPath odataPath, IWebApiControllerCo "Post" + entitySet.EntityType().Name, "Post"); } + else if (ODataRequestMethod.Patch == controllerContext.Request.Method) + { + // e.g. Try PatchCustomers first, then fall back to Patch action name + return actionMap.FindMatchingAction( + "Patch" + entitySet.Name, + "Patch"); + } } else if (odataPath.PathTemplate == "~/entityset/$count" && ODataRequestMethod.Get == controllerContext.Request.GetRequestMethodOrPreflightMethod()) diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/FunctionRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/FunctionRoutingConvention.cs index a32c3305c1..90d7c4192b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/FunctionRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/FunctionRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/MetadataRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/MetadataRoutingConvention.cs index 818e5448cb..5319c237fc 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/MetadataRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/MetadataRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Interfaces; @@ -79,4 +83,4 @@ internal static string SelectActionImpl(ODataPath odataPath, IWebApiControllerCo return null; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NavigationRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NavigationRoutingConvention.cs index 6b984ec86c..591714dd27 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NavigationRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NavigationRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -46,9 +50,9 @@ internal static string SelectActionImpl(ODataPath odataPath, IWebApiControllerCo return null; } - // It is not valid to *Put/Patch" to any collection-valued navigation property. + // It is not valid to *Put" to any collection-valued navigation property. if (navigationProperty.TargetMultiplicity() == EdmMultiplicity.Many && - (ODataRequestMethod.Put == method || ODataRequestMethod.Patch == method)) + ODataRequestMethod.Put == method) { return null; } diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NavigationSourceRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NavigationSourceRoutingConvention.cs index b853b96a1a..b485aca893 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NavigationSourceRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NavigationSourceRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.OData.UriParser; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NestedPathsRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NestedPathsRoutingConvention.cs new file mode 100644 index 0000000000..a582983078 --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/NestedPathsRoutingConvention.cs @@ -0,0 +1,93 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +#if NETCORE + +// TODO: [EnableNestedPaths] feature has not yet been ported to AspNet classic + +using System.Linq; +using Microsoft.AspNet.OData.Interfaces; +using Microsoft.OData.UriParser; + +namespace Microsoft.AspNet.OData.Routing.Conventions +{ + /// + /// An implementation of that handles GET requests + /// to arbitrarily nested paths. It requires a controller action with the [EnableNestedPaths] attribute. + /// This should be the last convention in order not to override other routing conventions that + /// rely on user-defined methods. + /// + public partial class NestedPathsRoutingConvention : NavigationSourceRoutingConvention + { + /// + /// Selects the action for OData requests. + /// + /// The OData path. + /// The controller context. + /// The action map. + /// + /// null if the request isn't handled by this convention; otherwise, the name of the selected action + /// + internal static string SelectActionImpl(ODataPath odataPath, IWebApiControllerContext controllerContext, IWebApiActionMap actionMap) + { + + ODataRequestMethod method = controllerContext.Request.GetRequestMethodOrPreflightMethod(); + + if (method != ODataRequestMethod.Get) + { + // [EnableNestedPaths] only supports GET requests + return null; + } + + // unsupported path segments + if (odataPath.PathTemplate.EndsWith("$ref")) + { + return null; + } + + ODataPathSegment firstSegment = odataPath.Segments.FirstOrDefault(); + + string sourceName; + if (firstSegment is EntitySetSegment entitySetSegment) + { + sourceName = entitySetSegment.EntitySet.Name; + } + else if (firstSegment is SingletonSegment singletonSegment) + { + sourceName = singletonSegment.Singleton.Name; + } + else + { + // this only supports paths starting with an entity set or singleton + return null; + } + + // if we did not find a matching action amongst the conventional user-defined methods + // then let's check if the controller has a Get method with [EnableNestedPaths] attribute + // which should be used to catch any nested GET request + string action = actionMap.FindMatchingAction("Get" + sourceName, "Get"); + if (action == null) + { + return null; + } + + IWebApiActionDescriptor descriptor = actionMap.GetActionDescriptor(action); + if (descriptor == null) + { + return null; + } + + if (!descriptor.GetCustomAttributes(/* inherit */ true).Any()) + { + return null; + } + + return descriptor.ActionName; + } + } +} +#endif diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/OperationImportRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/OperationImportRoutingConvention.cs index c20313b02d..5582082dce 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/OperationImportRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/OperationImportRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Interfaces; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/PropertyRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/PropertyRoutingConvention.cs index f8d5bc25cd..04ab44d36e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/PropertyRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/PropertyRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RefRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RefRoutingConvention.cs index 171b030eb4..e0ad45adb9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RefRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RefRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -112,4 +116,4 @@ private static bool IsSupportedRequestMethod(ODataRequestMethod method) ODataRequestMethod.Get == method); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RequestMethodExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RequestMethodExtensions.cs index 7791bcd0d0..fcda951443 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RequestMethodExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RequestMethodExtensions.cs @@ -1,4 +1,11 @@ -using System; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; using System.Collections.Generic; using System.Linq; using Microsoft.AspNet.OData.Interfaces; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RoutingConventionHelpers.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RoutingConventionHelpers.cs index 0fedebbc22..2c5fd5ffa4 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RoutingConventionHelpers.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/RoutingConventionHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/SelectControllerResult.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/SelectControllerResult.cs index 090972440a..4a771fbf1c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/SelectControllerResult.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/SelectControllerResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/SingletonRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/SingletonRoutingConvention.cs index f77a48ddef..40c4b556c2 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/SingletonRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/SingletonRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Interfaces; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/UnmappedRequestRoutingConvention.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/UnmappedRequestRoutingConvention.cs index f4b6448950..967f267510 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/UnmappedRequestRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Conventions/UnmappedRequestRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Interfaces; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/DefaultODataPathHandler.cs b/src/Microsoft.AspNet.OData.Shared/Routing/DefaultODataPathHandler.cs index a9d8393192..bcad356567 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/DefaultODataPathHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/DefaultODataPathHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/DefaultODataPathValidator.cs b/src/Microsoft.AspNet.OData.Shared/Routing/DefaultODataPathValidator.cs index 3b82f798d9..0a4ab53675 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/DefaultODataPathValidator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/DefaultODataPathValidator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Formatter; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/IODataPathHandler.cs b/src/Microsoft.AspNet.OData.Shared/Routing/IODataPathHandler.cs index 7eaaa46b2a..e658542b74 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/IODataPathHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/IODataPathHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; @@ -35,4 +39,4 @@ public interface IODataPathHandler /// ODataUrlKeyDelimiter UrlKeyDelimiter { get; set; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/IODataPathTemplateHandler.cs b/src/Microsoft.AspNet.OData.Shared/Routing/IODataPathTemplateHandler.cs index 947070edaf..bee4938d7f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/IODataPathTemplateHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/IODataPathTemplateHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/KeyValueParser.cs b/src/Microsoft.AspNet.OData.Shared/Routing/KeyValueParser.cs index 06dac87269..e7635fe52f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/KeyValueParser.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/KeyValueParser.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataOptionalParameter.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataOptionalParameter.cs index 82431b2fc0..b54d80bec0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataOptionalParameter.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataOptionalParameter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.OData.Edm; @@ -23,4 +27,4 @@ public void Add(IEdmOptionalParameter parameter) _optionalParameters.Add(parameter); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataParameterHelper.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataParameterHelper.cs index 0d3d6660f6..eebd2aac78 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataParameterHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataParameterHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataParameterValue.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataParameterValue.cs index 19e0f5b14d..f06bf36be9 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataParameterValue.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataParameterValue.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPath.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPath.cs index 0acf3a8c06..7a7eb799a1 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPath.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPath.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathParameterBindingAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathParameterBindingAttribute.cs index 5be9be4caa..55593fcfa0 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathParameterBindingAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathParameterBindingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Routing { diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathRouteConstraint.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathRouteConstraint.cs index 2e9f11a6cf..fcd8577be8 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathRouteConstraint.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathRouteConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentExtensions.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentExtensions.cs index d9a5b64480..1ae4b8465f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentExtensions.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentHandler.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentHandler.cs index 89f440eb48..d270e9d660 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentHandler.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentTranslator.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentTranslator.cs index 0637e63553..7c9834f8c2 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentTranslator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataPathSegmentTranslator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataRoute.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataRoute.cs index c10a9d5101..5c6258b31b 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataRoute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataRoute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; @@ -71,4 +75,4 @@ private static string UriEncode(string str) return escape; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataRouteAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataRouteAttribute.cs index f68f1694a8..58a177d558 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataRouteAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataRouteAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataRouteConstants.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataRouteConstants.cs index ef63fe81e7..0e05573f0f 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataRouteConstants.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataRouteConstants.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Routing { diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataRoutePrefixAttribute.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataRoutePrefixAttribute.cs index 54fd9bd3ad..28f847d237 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataRoutePrefixAttribute.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataRoutePrefixAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataSegmentKinds.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataSegmentKinds.cs index 215505b7dc..a3acb36b56 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataSegmentKinds.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataSegmentKinds.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Routing { diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/ODataVersionConstraint.cs b/src/Microsoft.AspNet.OData.Shared/Routing/ODataVersionConstraint.cs index ca9a36ddc3..6541dceb1d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/ODataVersionConstraint.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/ODataVersionConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/DynamicSegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/DynamicSegmentTemplate.cs index 87ceb198c0..da03080a4a 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/DynamicSegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/DynamicSegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/EntitySetSegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/EntitySetSegmentTemplate.cs index 2ac3afbacd..345bfe6138 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/EntitySetSegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/EntitySetSegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/KeySegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/KeySegmentTemplate.cs index 525ab9118f..1877f4bb0d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/KeySegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/KeySegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/NavigationPropertyLinkSegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/NavigationPropertyLinkSegmentTemplate.cs index d98f2a1001..3ae8f8e21e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/NavigationPropertyLinkSegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/NavigationPropertyLinkSegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/NavigationPropertySegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/NavigationPropertySegmentTemplate.cs index 70cb2ad92f..66f9492911 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/NavigationPropertySegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/NavigationPropertySegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplate.cs index 2abd4ba00b..eedaab4bb6 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.OData.UriParser; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplateOfT.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplateOfT.cs index 06c13caa02..0f1311e331 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplateOfT.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplateOfT.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.OData.UriParser; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplateTranslator.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplateTranslator.cs index 38d0bb8b57..357d6ddcdf 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplateTranslator.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathSegmentTemplateTranslator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathTemplate.cs index 50452bde3d..2826af3cec 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/ODataPathTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/OperationImportSegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/OperationImportSegmentTemplate.cs index 94deb63d54..4e9c493842 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/OperationImportSegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/OperationImportSegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/OperationSegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/OperationSegmentTemplate.cs index d2d30cdb35..c95a4bb93e 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/OperationSegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/OperationSegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/PathTemplateSegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/PathTemplateSegmentTemplate.cs index 95817a7df1..ff143cbb81 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/PathTemplateSegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/PathTemplateSegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/PropertySegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/PropertySegmentTemplate.cs index ab38d6a3dd..02bcbd2b64 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/PropertySegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/PropertySegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/SingletonSegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/SingletonSegmentTemplate.cs index f23f5dd5f8..208d94418d 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/SingletonSegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/SingletonSegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/Template/TypeSegmentTemplate.cs b/src/Microsoft.AspNet.OData.Shared/Routing/Template/TypeSegmentTemplate.cs index 85ce336de5..db1b5bda4c 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/Template/TypeSegmentTemplate.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/Template/TypeSegmentTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData.Shared/Routing/UnresolvedPathSegment.cs b/src/Microsoft.AspNet.OData.Shared/Routing/UnresolvedPathSegment.cs index e9e2e49c12..25f23a8715 100644 --- a/src/Microsoft.AspNet.OData.Shared/Routing/UnresolvedPathSegment.cs +++ b/src/Microsoft.AspNet.OData.Shared/Routing/UnresolvedPathSegment.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.OData.Edm; diff --git a/src/Microsoft.AspNet.OData.Shared/TimeZoneInfoHelper.cs b/src/Microsoft.AspNet.OData.Shared/TimeZoneInfoHelper.cs index 1c6e38925e..860896e644 100644 --- a/src/Microsoft.AspNet.OData.Shared/TimeZoneInfoHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/TimeZoneInfoHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/src/Microsoft.AspNet.OData.Shared/TransientAnnotations.cs b/src/Microsoft.AspNet.OData.Shared/TransientAnnotations.cs new file mode 100644 index 0000000000..1946f2f18b --- /dev/null +++ b/src/Microsoft.AspNet.OData.Shared/TransientAnnotations.cs @@ -0,0 +1,13 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using Microsoft.AspNet.OData.Common; + +namespace Microsoft.AspNet.OData +{ + internal static class TransientAnnotations + { + internal static HashSet TransientAnnotationTerms = new HashSet() { SRResources.ContentID, SRResources.DataModificationException }; + } +} diff --git a/src/Microsoft.AspNet.OData.Shared/TypeHelper.cs b/src/Microsoft.AspNet.OData.Shared/TypeHelper.cs index 54ef2adfb7..39aeb90981 100644 --- a/src/Microsoft.AspNet.OData.Shared/TypeHelper.cs +++ b/src/Microsoft.AspNet.OData.Shared/TypeHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/TypedDelta.cs b/src/Microsoft.AspNet.OData.Shared/TypedDelta.cs index c0704162ac..ad88b237bb 100644 --- a/src/Microsoft.AspNet.OData.Shared/TypedDelta.cs +++ b/src/Microsoft.AspNet.OData.Shared/TypedDelta.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -28,7 +32,7 @@ public abstract class TypedDelta : Delta /// True if it is a Delta generic type; false otherwise. internal static bool IsDeltaOfT(Type type) { - return type != null && TypeHelper.IsGenericType(type) && type.GetGenericTypeDefinition() == typeof(Delta<>); + return type != null && TypeHelper.IsGenericType(type) && typeof(Delta<>).IsAssignableFrom(type.GetGenericTypeDefinition()); } } } diff --git a/src/Microsoft.AspNet.OData.Shared/UnqualifiedCallAndEnumPrefixFreeResolver.cs b/src/Microsoft.AspNet.OData.Shared/UnqualifiedCallAndEnumPrefixFreeResolver.cs index bb2083b5c4..ed9ae2eef6 100644 --- a/src/Microsoft.AspNet.OData.Shared/UnqualifiedCallAndEnumPrefixFreeResolver.cs +++ b/src/Microsoft.AspNet.OData.Shared/UnqualifiedCallAndEnumPrefixFreeResolver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData.Shared/WebApiAssembliesResolver.cs b/src/Microsoft.AspNet.OData.Shared/WebApiAssembliesResolver.cs index 96de373233..b5fdf85d8d 100644 --- a/src/Microsoft.AspNet.OData.Shared/WebApiAssembliesResolver.cs +++ b/src/Microsoft.AspNet.OData.Shared/WebApiAssembliesResolver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Interfaces; diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiActionDescriptor.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiActionDescriptor.cs index b87c7e0d74..6cb29f7cd1 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiActionDescriptor.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiActionDescriptor.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiActionMap.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiActionMap.cs index ae0cda1618..33717781ea 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiActionMap.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiActionMap.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http.Controllers; @@ -41,5 +45,17 @@ public bool Contains(string name) { return this.innerMap.Contains(name); } + + /// + /// Gets the action descriptor of the specified action + /// + /// The name of the action + /// The if it exists, otherwise null + public IWebApiActionDescriptor GetActionDescriptor(string actionName) + { + IGrouping group = this.innerMap.FirstOrDefault(g => g.Key == actionName); + HttpActionDescriptor descriptor = group?.FirstOrDefault(); + return descriptor == null ? null : new WebApiActionDescriptor(descriptor); + } } } diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiAssembliesResolver.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiAssembliesResolver.cs index 0e1195f470..3ef38cf3ec 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiAssembliesResolver.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiAssembliesResolver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Reflection; diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiContext.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiContext.cs index 16c84d23c5..c77bd2dec8 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiContext.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiControllerContext.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiControllerContext.cs index 624fd44610..63870a699d 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiControllerContext.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiControllerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiOptions.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiOptions.cs index 8158c94407..b737f206a9 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiOptions.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiRequestHeaders.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiRequestHeaders.cs index be6739858c..492f0eb4b3 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiRequestHeaders.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiRequestHeaders.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http.Headers; diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiRequestMessage.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiRequestMessage.cs index e075bdb79a..86b2d3756c 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiRequestMessage.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiRequestMessage.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Adapters/WebApiUrlHelper.cs b/src/Microsoft.AspNet.OData/Adapters/WebApiUrlHelper.cs index 0b0c67ef4a..877de940c6 100644 --- a/src/Microsoft.AspNet.OData/Adapters/WebApiUrlHelper.cs +++ b/src/Microsoft.AspNet.OData/Adapters/WebApiUrlHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Web.Http.Routing; diff --git a/src/Microsoft.AspNet.OData/Batch/ChangeSetRequestItem.cs b/src/Microsoft.AspNet.OData/Batch/ChangeSetRequestItem.cs index 4c8a3772e3..516eb0fd74 100644 --- a/src/Microsoft.AspNet.OData/Batch/ChangeSetRequestItem.cs +++ b/src/Microsoft.AspNet.OData/Batch/ChangeSetRequestItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -120,4 +124,4 @@ internal static void DisposeResponses(List responses) } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/ChangeSetResponseItem.cs b/src/Microsoft.AspNet.OData/Batch/ChangeSetResponseItem.cs index f0913151f7..1c371be917 100644 --- a/src/Microsoft.AspNet.OData/Batch/ChangeSetResponseItem.cs +++ b/src/Microsoft.AspNet.OData/Batch/ChangeSetResponseItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -94,4 +98,4 @@ protected override void Dispose(bool disposing) } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/DefaultODataBatchHandler.cs b/src/Microsoft.AspNet.OData/Batch/DefaultODataBatchHandler.cs index 6c83bd05bd..c353b74df0 100644 --- a/src/Microsoft.AspNet.OData/Batch/DefaultODataBatchHandler.cs +++ b/src/Microsoft.AspNet.OData/Batch/DefaultODataBatchHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -158,4 +162,4 @@ public virtual async Task> ParseBatchRequestsAsync( return requests; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/LazyStreamContent.cs b/src/Microsoft.AspNet.OData/Batch/LazyStreamContent.cs index ff761d2035..dff21c788d 100644 --- a/src/Microsoft.AspNet.OData/Batch/LazyStreamContent.cs +++ b/src/Microsoft.AspNet.OData/Batch/LazyStreamContent.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; @@ -43,4 +47,4 @@ protected override bool TryComputeLength(out long length) return false; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/ODataBatchContent.cs b/src/Microsoft.AspNet.OData/Batch/ODataBatchContent.cs index ba5549d2ed..957f2e48c5 100644 --- a/src/Microsoft.AspNet.OData/Batch/ODataBatchContent.cs +++ b/src/Microsoft.AspNet.OData/Batch/ODataBatchContent.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Batch/ODataBatchHandler.cs b/src/Microsoft.AspNet.OData/Batch/ODataBatchHandler.cs index cbafe78421..ed88c12660 100644 --- a/src/Microsoft.AspNet.OData/Batch/ODataBatchHandler.cs +++ b/src/Microsoft.AspNet.OData/Batch/ODataBatchHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -79,4 +83,4 @@ public virtual Uri GetBaseUri(HttpRequestMessage request) return request.GetODataBatchBaseUri(ODataRouteName); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/ODataBatchHttpRequestMessageExtensions.cs b/src/Microsoft.AspNet.OData/Batch/ODataBatchHttpRequestMessageExtensions.cs index b42cafc1a8..9fb7a0eab3 100644 --- a/src/Microsoft.AspNet.OData/Batch/ODataBatchHttpRequestMessageExtensions.cs +++ b/src/Microsoft.AspNet.OData/Batch/ODataBatchHttpRequestMessageExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -297,4 +301,4 @@ internal static Uri GetODataBatchBaseUri(this HttpRequestMessage request, string } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/ODataBatchReaderExtensions.cs b/src/Microsoft.AspNet.OData/Batch/ODataBatchReaderExtensions.cs index a686d3aafb..338ec0b673 100644 --- a/src/Microsoft.AspNet.OData/Batch/ODataBatchReaderExtensions.cs +++ b/src/Microsoft.AspNet.OData/Batch/ODataBatchReaderExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -190,4 +194,4 @@ private static async Task ReadOperationInternalAsync( return request; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/ODataBatchRequestItem.cs b/src/Microsoft.AspNet.OData/Batch/ODataBatchRequestItem.cs index 7d13125efd..e60032c24d 100644 --- a/src/Microsoft.AspNet.OData/Batch/ODataBatchRequestItem.cs +++ b/src/Microsoft.AspNet.OData/Batch/ODataBatchRequestItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -99,4 +103,4 @@ public void Dispose() /// true to release both managed and unmanaged resources; false to release only unmanaged resources. protected abstract void Dispose(bool disposing); } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/ODataBatchResponseItem.cs b/src/Microsoft.AspNet.OData/Batch/ODataBatchResponseItem.cs index 06195535e2..fb4dbc6d9b 100644 --- a/src/Microsoft.AspNet.OData/Batch/ODataBatchResponseItem.cs +++ b/src/Microsoft.AspNet.OData/Batch/ODataBatchResponseItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -146,4 +150,4 @@ internal virtual bool IsResponseSuccessful() /// true to release both managed and unmanaged resources; false to release only unmanaged resources. protected abstract void Dispose(bool disposing); } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/ODataHttpContentExtensions.cs b/src/Microsoft.AspNet.OData/Batch/ODataHttpContentExtensions.cs index cf05428620..d02cf59ada 100644 --- a/src/Microsoft.AspNet.OData/Batch/ODataHttpContentExtensions.cs +++ b/src/Microsoft.AspNet.OData/Batch/ODataHttpContentExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel; @@ -56,4 +60,4 @@ public static async Task GetODataMessageReaderAsync(this Htt return oDataMessageReader; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/OperationRequestItem.cs b/src/Microsoft.AspNet.OData/Batch/OperationRequestItem.cs index 3ea9d4fa8a..6129771c04 100644 --- a/src/Microsoft.AspNet.OData/Batch/OperationRequestItem.cs +++ b/src/Microsoft.AspNet.OData/Batch/OperationRequestItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -69,4 +73,4 @@ public override IEnumerable GetResourcesForDisposal() return Request.GetResourcesForDisposal(); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/OperationResponseItem.cs b/src/Microsoft.AspNet.OData/Batch/OperationResponseItem.cs index 131e7c138b..9949e064da 100644 --- a/src/Microsoft.AspNet.OData/Batch/OperationResponseItem.cs +++ b/src/Microsoft.AspNet.OData/Batch/OperationResponseItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Threading; @@ -66,4 +70,4 @@ protected override void Dispose(bool disposing) } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Batch/UnbufferedODataBatchHandler.cs b/src/Microsoft.AspNet.OData/Batch/UnbufferedODataBatchHandler.cs index 5ce3bba9e4..311d8d3388 100644 --- a/src/Microsoft.AspNet.OData/Batch/UnbufferedODataBatchHandler.cs +++ b/src/Microsoft.AspNet.OData/Batch/UnbufferedODataBatchHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -196,4 +200,4 @@ public virtual async Task ExecuteChangeSetAsync(ODataBat return new ChangeSetResponseItem(changeSetResponse); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Builder/ODataConventionModelBuilder.cs b/src/Microsoft.AspNet.OData/Builder/ODataConventionModelBuilder.cs index 418681263c..96e0946cb1 100644 --- a/src/Microsoft.AspNet.OData/Builder/ODataConventionModelBuilder.cs +++ b/src/Microsoft.AspNet.OData/Builder/ODataConventionModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using System.Web.Http.Dispatcher; diff --git a/src/Microsoft.AspNet.OData/ETagMessageHandler.cs b/src/Microsoft.AspNet.OData/ETagMessageHandler.cs index e3b4c97b2e..150625994a 100644 --- a/src/Microsoft.AspNet.OData/ETagMessageHandler.cs +++ b/src/Microsoft.AspNet.OData/ETagMessageHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Net.Http.Headers; diff --git a/src/Microsoft.AspNet.OData/EnableQueryAttribute.cs b/src/Microsoft.AspNet.OData/EnableQueryAttribute.cs index c40d51a4ab..893605419c 100644 --- a/src/Microsoft.AspNet.OData/EnableQueryAttribute.cs +++ b/src/Microsoft.AspNet.OData/EnableQueryAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -195,4 +199,4 @@ public virtual IEdmModel GetModel(Type elementClrType, HttpRequestMessage reques return model; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Extensions/HttpActionDescriptorExtensions.cs b/src/Microsoft.AspNet.OData/Extensions/HttpActionDescriptorExtensions.cs index 4591903d05..96641d70fd 100644 --- a/src/Microsoft.AspNet.OData/Extensions/HttpActionDescriptorExtensions.cs +++ b/src/Microsoft.AspNet.OData/Extensions/HttpActionDescriptorExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel; diff --git a/src/Microsoft.AspNet.OData/Extensions/HttpConfigurationExtensions.cs b/src/Microsoft.AspNet.OData/Extensions/HttpConfigurationExtensions.cs index 9e2cf70ea5..1f05cd45fa 100644 --- a/src/Microsoft.AspNet.OData/Extensions/HttpConfigurationExtensions.cs +++ b/src/Microsoft.AspNet.OData/Extensions/HttpConfigurationExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Extensions/HttpErrorExtensions.cs b/src/Microsoft.AspNet.OData/Extensions/HttpErrorExtensions.cs index b50cb314ae..969bd1b1c1 100644 --- a/src/Microsoft.AspNet.OData/Extensions/HttpErrorExtensions.cs +++ b/src/Microsoft.AspNet.OData/Extensions/HttpErrorExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel; diff --git a/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageExtensions.cs b/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageExtensions.cs index 64ebbe0532..ca30940751 100644 --- a/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageExtensions.cs +++ b/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageProperties.cs b/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageProperties.cs index b4db1f5ab7..17851d1e03 100644 --- a/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageProperties.cs +++ b/src/Microsoft.AspNet.OData/Extensions/HttpRequestMessageProperties.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Extensions/UrlHelperExtensions.cs b/src/Microsoft.AspNet.OData/Extensions/UrlHelperExtensions.cs index 5a8019ed36..19c0475a12 100644 --- a/src/Microsoft.AspNet.OData/Extensions/UrlHelperExtensions.cs +++ b/src/Microsoft.AspNet.OData/Extensions/UrlHelperExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Formatter/Deserialization/DefaultODataDeserializerProvider.cs b/src/Microsoft.AspNet.OData/Formatter/Deserialization/DefaultODataDeserializerProvider.cs index 51ce178032..18f9d1fc94 100644 --- a/src/Microsoft.AspNet.OData/Formatter/Deserialization/DefaultODataDeserializerProvider.cs +++ b/src/Microsoft.AspNet.OData/Formatter/Deserialization/DefaultODataDeserializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/Formatter/Deserialization/ODataDeserializerContext.cs b/src/Microsoft.AspNet.OData/Formatter/Deserialization/ODataDeserializerContext.cs index 16ceeb06ed..e71283bba8 100644 --- a/src/Microsoft.AspNet.OData/Formatter/Deserialization/ODataDeserializerContext.cs +++ b/src/Microsoft.AspNet.OData/Formatter/Deserialization/ODataDeserializerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/Formatter/Deserialization/ODataDeserializerProvider.cs b/src/Microsoft.AspNet.OData/Formatter/Deserialization/ODataDeserializerProvider.cs index 963d135c93..b4582e6e55 100644 --- a/src/Microsoft.AspNet.OData/Formatter/Deserialization/ODataDeserializerProvider.cs +++ b/src/Microsoft.AspNet.OData/Formatter/Deserialization/ODataDeserializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/Formatter/ODataCountMediaTypeMapping.cs b/src/Microsoft.AspNet.OData/Formatter/ODataCountMediaTypeMapping.cs index effb51e6e8..62be694235 100644 --- a/src/Microsoft.AspNet.OData/Formatter/ODataCountMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData/Formatter/ODataCountMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Net.Http.Formatting; diff --git a/src/Microsoft.AspNet.OData/Formatter/ODataMediaTypeFormatter.cs b/src/Microsoft.AspNet.OData/Formatter/ODataMediaTypeFormatter.cs index a9c0dd4dee..c274da5d8f 100644 --- a/src/Microsoft.AspNet.OData/Formatter/ODataMediaTypeFormatter.cs +++ b/src/Microsoft.AspNet.OData/Formatter/ODataMediaTypeFormatter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -392,4 +396,4 @@ public static Uri GetDefaultBaseAddress(HttpRequestMessage request) return baseAddress[baseAddress.Length - 1] != '/' ? new Uri(baseAddress + '/') : new Uri(baseAddress); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Formatter/ODataMediaTypeFormatters.cs b/src/Microsoft.AspNet.OData/Formatter/ODataMediaTypeFormatters.cs index 5c1cbdd6cb..7e41709b2f 100644 --- a/src/Microsoft.AspNet.OData/Formatter/ODataMediaTypeFormatters.cs +++ b/src/Microsoft.AspNet.OData/Formatter/ODataMediaTypeFormatters.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http.Formatting; diff --git a/src/Microsoft.AspNet.OData/Formatter/ODataModelBinderProvider.cs b/src/Microsoft.AspNet.OData/Formatter/ODataModelBinderProvider.cs index 74d50f24d5..90606f0494 100644 --- a/src/Microsoft.AspNet.OData/Formatter/ODataModelBinderProvider.cs +++ b/src/Microsoft.AspNet.OData/Formatter/ODataModelBinderProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/src/Microsoft.AspNet.OData/Formatter/ODataRawValueMediaTypeMapping.cs b/src/Microsoft.AspNet.OData/Formatter/ODataRawValueMediaTypeMapping.cs index 9d1e134784..1912978145 100644 --- a/src/Microsoft.AspNet.OData/Formatter/ODataRawValueMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData/Formatter/ODataRawValueMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Net.Http.Formatting; diff --git a/src/Microsoft.AspNet.OData/Formatter/ODataStreamMediaTypeMapping.cs b/src/Microsoft.AspNet.OData/Formatter/ODataStreamMediaTypeMapping.cs index f45ddde865..a1c54a636d 100644 --- a/src/Microsoft.AspNet.OData/Formatter/ODataStreamMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData/Formatter/ODataStreamMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Net.Http.Formatting; diff --git a/src/Microsoft.AspNet.OData/Formatter/QueryStringMediaTypeMapping.cs b/src/Microsoft.AspNet.OData/Formatter/QueryStringMediaTypeMapping.cs index 3469479365..98cea0889f 100644 --- a/src/Microsoft.AspNet.OData/Formatter/QueryStringMediaTypeMapping.cs +++ b/src/Microsoft.AspNet.OData/Formatter/QueryStringMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/Formatter/Serialization/DefaultODataSerializerProvider.cs b/src/Microsoft.AspNet.OData/Formatter/Serialization/DefaultODataSerializerProvider.cs index 158de73965..0f7f434ab7 100644 --- a/src/Microsoft.AspNet.OData/Formatter/Serialization/DefaultODataSerializerProvider.cs +++ b/src/Microsoft.AspNet.OData/Formatter/Serialization/DefaultODataSerializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataErrorSerializer.cs b/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataErrorSerializer.cs index 3d20d70e37..2a828d4779 100644 --- a/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataErrorSerializer.cs +++ b/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataErrorSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using Microsoft.AspNet.OData.Extensions; diff --git a/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataSerializerContext.cs b/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataSerializerContext.cs index 78bb92f55c..386f57586b 100644 --- a/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataSerializerContext.cs +++ b/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataSerializerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataSerializerProvider.cs b/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataSerializerProvider.cs index 0506d43a1c..06d112c003 100644 --- a/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataSerializerProvider.cs +++ b/src/Microsoft.AspNet.OData/Formatter/Serialization/ODataSerializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/FromODataUriAttribute.cs b/src/Microsoft.AspNet.OData/FromODataUriAttribute.cs index e471bbf805..51edbda157 100644 --- a/src/Microsoft.AspNet.OData/FromODataUriAttribute.cs +++ b/src/Microsoft.AspNet.OData/FromODataUriAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/GetNextPageHelper.cs b/src/Microsoft.AspNet.OData/GetNextPageHelper.cs index fdf77fe483..45a7de7d9c 100644 --- a/src/Microsoft.AspNet.OData/GetNextPageHelper.cs +++ b/src/Microsoft.AspNet.OData/GetNextPageHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData/GlobalSuppressions.cs b/src/Microsoft.AspNet.OData/GlobalSuppressions.cs index bebd2a6b5b..a4a7b94422 100644 --- a/src/Microsoft.AspNet.OData/GlobalSuppressions.cs +++ b/src/Microsoft.AspNet.OData/GlobalSuppressions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; @@ -61,3 +65,35 @@ [assembly: SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Scope = "member", Target = "Microsoft.AspNet.OData.Builder.IODataInstanceAnnotationContainer.#GetAllResourceAnnotations()")] [assembly: SuppressMessage("Microsoft.Design", "CA1024:UsePropertiesWhereAppropriate", Scope = "member", Target = "Microsoft.AspNet.OData.Builder.IODataInstanceAnnotationContainer.#GetResourceAnnotations()")] [assembly: SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly", Scope = "member", Target = "Microsoft.AspNet.OData.Common.Error.#PropertyNullOrWhiteSpace()")] +[assembly: SuppressMessage("Microsoft.Design", "CA1033:InterfaceMethodsShouldBeCallableByChildTypes", Scope = "member", Target = "Microsoft.AspNet.OData.Delta`1.#Microsoft.AspNet.OData.IEdmObject.GetEdmType()")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Upsert", Scope = "member", Target = "Microsoft.AspNet.OData.DataModificationOperationKind.#Upsert")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "Upsert", Scope = "member", Target = "Org.OData.Core.V1.DataModificationOperationKind.#Upsert")] +[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "Org.OData.Core.V1")] +[assembly: SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces", Scope = "type", Target = "Microsoft.AspNet.OData.IDeltaSet")] +[assembly: SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#", Scope = "member", Target = "Microsoft.AspNet.OData.ODataAPIHandler`1.#TryGet(System.Collections.Generic.IDictionary`2,!0&,System.String&)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#", Scope = "member", Target = "Microsoft.AspNet.OData.ODataAPIHandler`1.#TryDelete(System.Collections.Generic.IDictionary`2,System.String&)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#", Scope = "member", Target = "Microsoft.AspNet.OData.ODataAPIHandler`1.#TryGet(System.Collections.Generic.IDictionary`2,!0&,System.String&)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1040:AvoidEmptyInterfaces", Scope = "type", Target = "Microsoft.AspNet.OData.IODataAPIHandler")] +[assembly: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "Microsoft.AspNet.OData.Formatter.Serialization.DefaultODataSerializerProvider.#GetODataPayloadSerializerImpl(System.Type,System.Func`1,Microsoft.AspNet.OData.Routing.ODataPath,System.Type)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#", Scope = "member", Target = "Microsoft.AspNet.OData.EdmODataAPIHandler.#TryDelete(System.Collections.Generic.IDictionary`2,System.String&)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#", Scope = "member", Target = "Microsoft.AspNet.OData.EdmODataAPIHandler.#TryGet(System.Collections.Generic.IDictionary`2,Microsoft.AspNet.OData.EdmStructuredObject&,System.String&)")] +[assembly: SuppressMessage("Microsoft.Globalization", "CA1305:SpecifyIFormatProvider", MessageId = "System.String.Format(System.String,System.Object,System.Object)", Scope = "member", Target = "Microsoft.AspNet.OData.Formatter.ClrTypeCache+EdmTypeCacheItemComparer.#GetHashCode(Microsoft.AspNet.OData.Formatter.ClrTypeCache+EdmTypeCacheItem)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#", Scope = "member", Target = "Microsoft.AspNet.OData.EdmODataAPIHandler.#TryCreate(Microsoft.AspNet.OData.IEdmChangedObject,Microsoft.AspNet.OData.IEdmStructuredObject&,System.String&)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#", Scope = "member", Target = "Microsoft.AspNet.OData.EdmODataAPIHandler.#TryCreate(Microsoft.AspNet.OData.IEdmChangedObject,Microsoft.AspNet.OData.IEdmStructuredObject&,System.String&)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "2#", Scope = "member", Target = "Microsoft.AspNet.OData.EdmODataAPIHandler.#TryGet(System.Collections.Generic.IDictionary`2,Microsoft.AspNet.OData.IEdmStructuredObject&,System.String&)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1021:AvoidOutParameters", MessageId = "1#", Scope = "member", Target = "Microsoft.AspNet.OData.EdmODataAPIHandler.#TryGet(System.Collections.Generic.IDictionary`2,Microsoft.AspNet.OData.IEdmStructuredObject&,System.String&)")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "Microsoft.AspNet.OData.EdmDeltaDeletedEntityObject.#_edmType")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "Microsoft.AspNet.OData.EdmDeltaDeletedLink.#_edmType")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "Microsoft.AspNet.OData.EdmDeltaEntityObject.#_edmType")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1823:AvoidUnusedPrivateFields", Scope = "member", Target = "Microsoft.AspNet.OData.EdmDeltaLink.#_edmType")] +[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceDeserializer.#CreateKeyProperties(System.Uri,Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeserializerContext)")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceDeserializer.#CreateResourceWrapper(Microsoft.OData.Edm.IEdmTypeReference,Microsoft.AspNet.OData.Formatter.Deserialization.ODataEntityReferenceLinkBase,Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeserializerContext)")] +[assembly: SuppressMessage("Microsoft.Performance", "CA1822:MarkMembersAsStatic", Scope = "member", Target = "Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceDeserializer.#UpdateResourceWrapper(Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper,Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeserializerContext)")] +[assembly: SuppressMessage("Microsoft.Maintainability", "CA1506:AvoidExcessiveClassCoupling", Scope = "member", Target = "Microsoft.AspNet.OData.Delta`1.#CopyChangedValues(!0,Microsoft.AspNet.OData.ODataAPIHandler`1,Microsoft.AspNet.OData.ODataAPIHandlerFactory)")] +[assembly: SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Scope = "member", Target = "Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceDeserializer.#GetODataPath(System.String,Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeserializerContext)")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "API", Scope = "type", Target = "Microsoft.AspNet.OData.ODataAPIHandler`1")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "API", Scope = "type", Target = "Microsoft.AspNet.OData.IODataAPIHandler")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "API", Scope = "type", Target = "Microsoft.AspNet.OData.ODataEdmAPIHandlerFactory")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "API", Scope = "type", Target = "Microsoft.AspNet.OData.ODataAPIResponseStatus")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "API", Scope = "type", Target = "Microsoft.AspNet.OData.EdmODataAPIHandler")] +[assembly: SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "API", Scope = "type", Target = "Microsoft.AspNet.OData.ODataAPIHandlerFactory")] diff --git a/src/Microsoft.AspNet.OData/HttpRequestScope.cs b/src/Microsoft.AspNet.OData/HttpRequestScope.cs index 7717cfae39..7e34d9f46c 100644 --- a/src/Microsoft.AspNet.OData/HttpRequestScope.cs +++ b/src/Microsoft.AspNet.OData/HttpRequestScope.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Nightly.Release.nuspec b/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Nightly.nuspec similarity index 80% rename from src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Nightly.Release.nuspec rename to src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Nightly.nuspec index eb31988526..4ce723cb59 100644 --- a/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Nightly.Release.nuspec +++ b/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Nightly.nuspec @@ -3,17 +3,18 @@ Microsoft.AspNet.OData Microsoft ASP.NET Web API 2.2 for OData v4.0 - $VersionFullSemantic$-Nightly$NightlyBuildVersion$ - Microsoft - © Microsoft Corporation. All rights reserved. + $VersionNuGetSemantic$-Nightly$NightlyBuildVersion$ + OData (.NET Foundation) + © .NET Foundation and Contributors. All rights reserved. This package contains everything you need to create OData v4.0 endpoints using ASP.NET Web API and to support OData query syntax for your web APIs. This package contains everything you need to create OData v4.0 endpoints using ASP.NET Web API. en-US http://odata.github.io - https://raw.githubusercontent.com/OData/WebApi/master/License.txt + MIT true Microsoft AspNet WebApi AspNetWebApi OData - http://static.tumblr.com/hgchgxz/9ualgdf98/icon.png + images\odata.png + @@ -31,5 +32,6 @@ + \ No newline at end of file diff --git a/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Release.nuspec b/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Release.nuspec index ad6592619b..dbb138fc74 100644 --- a/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Release.nuspec +++ b/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.Release.nuspec @@ -4,17 +4,18 @@ Microsoft.AspNet.OData Microsoft ASP.NET Web API 2.2 for OData v4.0 $VersionNuGetSemantic$ - Microsoft - © Microsoft Corporation. All rights reserved. + OData (.NET Foundation) + © .NET Foundation and Contributors. All rights reserved. This package contains everything you need to create OData v4.0 endpoints using ASP.NET Web API and to support OData query syntax for your web APIs. This package contains everything you need to create OData v4.0 endpoints using ASP.NET Web API. https://docs.microsoft.com/en-us/odata/changelog/webapi-7x en-US http://odata.github.io - https://raw.githubusercontent.com/OData/WebApi/master/License.txt + MIT true Microsoft AspNet WebApi AspNetWebApi OData - http://static.tumblr.com/hgchgxz/9ualgdf98/icon.png + images\odata.png + @@ -32,5 +33,6 @@ + \ No newline at end of file diff --git a/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.csproj b/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.csproj index 032dcfc4aa..f815b8ad52 100644 --- a/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.csproj +++ b/src/Microsoft.AspNet.OData/Microsoft.AspNet.OData.csproj @@ -30,14 +30,14 @@ ..\..\sln\packages\Microsoft.Extensions.DependencyInjection.Abstractions.1.0.0\lib\netstandard1.0\Microsoft.Extensions.DependencyInjection.Abstractions.dll True - - ..\..\sln\packages\Microsoft.OData.Core.7.9.0\lib\net45\Microsoft.OData.Core.dll + + ..\..\sln\packages\Microsoft.OData.Core.7.9.1\lib\net45\Microsoft.OData.Core.dll - - ..\..\sln\packages\Microsoft.OData.Edm.7.9.0\lib\net45\Microsoft.OData.Edm.dll + + ..\..\sln\packages\Microsoft.OData.Edm.7.9.1\lib\net45\Microsoft.OData.Edm.dll - - ..\..\sln\packages\Microsoft.Spatial.7.9.0\lib\net45\Microsoft.Spatial.dll + + ..\..\sln\packages\Microsoft.Spatial.7.9.1\lib\net45\Microsoft.Spatial.dll ..\..\sln\packages\Newtonsoft.Json.6.0.4\lib\net45\Newtonsoft.Json.dll diff --git a/src/Microsoft.AspNet.OData/NonValidatingParameterBindingAttribute.cs b/src/Microsoft.AspNet.OData/NonValidatingParameterBindingAttribute.cs index f3c165ed9e..d2947c5e08 100644 --- a/src/Microsoft.AspNet.OData/NonValidatingParameterBindingAttribute.cs +++ b/src/Microsoft.AspNet.OData/NonValidatingParameterBindingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/ODataController.cs b/src/Microsoft.AspNet.OData/ODataController.cs index 34d6bbd99e..bbdcd80870 100644 --- a/src/Microsoft.AspNet.OData/ODataController.cs +++ b/src/Microsoft.AspNet.OData/ODataController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using System.Web.Http.Description; diff --git a/src/Microsoft.AspNet.OData/ODataFormattingAttribute.cs b/src/Microsoft.AspNet.OData/ODataFormattingAttribute.cs index 52112eddd9..a132335722 100644 --- a/src/Microsoft.AspNet.OData/ODataFormattingAttribute.cs +++ b/src/Microsoft.AspNet.OData/ODataFormattingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/ODataMessageWrapperHelper.cs b/src/Microsoft.AspNet.OData/ODataMessageWrapperHelper.cs index 8e954dd882..21397448ef 100644 --- a/src/Microsoft.AspNet.OData/ODataMessageWrapperHelper.cs +++ b/src/Microsoft.AspNet.OData/ODataMessageWrapperHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/ODataNullValueMessageHandler.cs b/src/Microsoft.AspNet.OData/ODataNullValueMessageHandler.cs index b6ce56fc0a..6ae28c34db 100644 --- a/src/Microsoft.AspNet.OData/ODataNullValueMessageHandler.cs +++ b/src/Microsoft.AspNet.OData/ODataNullValueMessageHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/ODataQueryParameterBindingAttribute.cs b/src/Microsoft.AspNet.OData/ODataQueryParameterBindingAttribute.cs index 559d05fe54..ff5da85c8b 100644 --- a/src/Microsoft.AspNet.OData/ODataQueryParameterBindingAttribute.cs +++ b/src/Microsoft.AspNet.OData/ODataQueryParameterBindingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData/ODataRoutingAttribute.cs b/src/Microsoft.AspNet.OData/ODataRoutingAttribute.cs index 58f4970dec..132d296330 100644 --- a/src/Microsoft.AspNet.OData/ODataRoutingAttribute.cs +++ b/src/Microsoft.AspNet.OData/ODataRoutingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; @@ -48,4 +52,4 @@ public void Initialize(HttpControllerSettings controllerSettings, HttpController services.Insert(typeof(ValueProviderFactory), 0, new ODataValueProviderFactory()); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/PerRequestActionValueBinder.cs b/src/Microsoft.AspNet.OData/PerRequestActionValueBinder.cs index af8ff66d1a..bcda9e5805 100644 --- a/src/Microsoft.AspNet.OData/PerRequestActionValueBinder.cs +++ b/src/Microsoft.AspNet.OData/PerRequestActionValueBinder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/PerRequestContentNegotiator.cs b/src/Microsoft.AspNet.OData/PerRequestContentNegotiator.cs index e72d6419fe..04473a476a 100644 --- a/src/Microsoft.AspNet.OData/PerRequestContentNegotiator.cs +++ b/src/Microsoft.AspNet.OData/PerRequestContentNegotiator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/PerRequestParameterBinding.cs b/src/Microsoft.AspNet.OData/PerRequestParameterBinding.cs index 553e6a7078..320d92f709 100644 --- a/src/Microsoft.AspNet.OData/PerRequestParameterBinding.cs +++ b/src/Microsoft.AspNet.OData/PerRequestParameterBinding.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNet.OData/PerRouteContainer.cs b/src/Microsoft.AspNet.OData/PerRouteContainer.cs index 502de2ec2f..8f118bfc16 100644 --- a/src/Microsoft.AspNet.OData/PerRouteContainer.cs +++ b/src/Microsoft.AspNet.OData/PerRouteContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Concurrent; diff --git a/src/Microsoft.AspNet.OData/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.OData/Properties/AssemblyInfo.cs index 9520935151..4bd46c88f7 100644 --- a/src/Microsoft.AspNet.OData/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.OData/Properties/AssemblyInfo.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; using System.Runtime.CompilerServices; diff --git a/src/Microsoft.AspNet.OData/Query/ODataQueryOptions.cs b/src/Microsoft.AspNet.OData/Query/ODataQueryOptions.cs index 77d66d7185..d7ea0e6fa2 100644 --- a/src/Microsoft.AspNet.OData/Query/ODataQueryOptions.cs +++ b/src/Microsoft.AspNet.OData/Query/ODataQueryOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/Query/ODataQueryOptionsOfTEntity.cs b/src/Microsoft.AspNet.OData/Query/ODataQueryOptionsOfTEntity.cs index 682fe44c8d..60382e9c69 100644 --- a/src/Microsoft.AspNet.OData/Query/ODataQueryOptionsOfTEntity.cs +++ b/src/Microsoft.AspNet.OData/Query/ODataQueryOptionsOfTEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNet.OData/Query/PlainTextODataQueryOptionsParser.cs b/src/Microsoft.AspNet.OData/Query/PlainTextODataQueryOptionsParser.cs index 0641e397fa..f33f64fb22 100644 --- a/src/Microsoft.AspNet.OData/Query/PlainTextODataQueryOptionsParser.cs +++ b/src/Microsoft.AspNet.OData/Query/PlainTextODataQueryOptionsParser.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNet.OData/Query/QueryFilterProvider.cs b/src/Microsoft.AspNet.OData/Query/QueryFilterProvider.cs index e11ce94009..ae9c1b462e 100644 --- a/src/Microsoft.AspNet.OData/Query/QueryFilterProvider.cs +++ b/src/Microsoft.AspNet.OData/Query/QueryFilterProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNet.OData/ResourceContext.cs b/src/Microsoft.AspNet.OData/ResourceContext.cs index b467ff7b5a..81e32fcf22 100644 --- a/src/Microsoft.AspNet.OData/ResourceContext.cs +++ b/src/Microsoft.AspNet.OData/ResourceContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Web.Http.Routing; diff --git a/src/Microsoft.AspNet.OData/ResourceSetContext.cs b/src/Microsoft.AspNet.OData/ResourceSetContext.cs index 0ad2118ea0..70ffe8a22d 100644 --- a/src/Microsoft.AspNet.OData/ResourceSetContext.cs +++ b/src/Microsoft.AspNet.OData/ResourceSetContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/Results/CreatedODataResult.cs b/src/Microsoft.AspNet.OData/Results/CreatedODataResult.cs index a2030a7660..4f563b1696 100644 --- a/src/Microsoft.AspNet.OData/Results/CreatedODataResult.cs +++ b/src/Microsoft.AspNet.OData/Results/CreatedODataResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Results/ResultHelpers.cs b/src/Microsoft.AspNet.OData/Results/ResultHelpers.cs index d77e88a95c..b252a447a8 100644 --- a/src/Microsoft.AspNet.OData/Results/ResultHelpers.cs +++ b/src/Microsoft.AspNet.OData/Results/ResultHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net; diff --git a/src/Microsoft.AspNet.OData/Results/UpdatedODataResult.cs b/src/Microsoft.AspNet.OData/Results/UpdatedODataResult.cs index d9a5b5c6ab..dd9f4ef4ed 100644 --- a/src/Microsoft.AspNet.OData/Results/UpdatedODataResult.cs +++ b/src/Microsoft.AspNet.OData/Results/UpdatedODataResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/ActionRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/ActionRoutingConvention.cs index bb75d7467e..3fe1d77c26 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/ActionRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/ActionRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/AttributeRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/AttributeRoutingConvention.cs index d3742c4249..313268b4bb 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/AttributeRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/AttributeRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/DynamicPropertyRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/DynamicPropertyRoutingConvention.cs index e3c0a91230..cbe9c15adc 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/DynamicPropertyRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/DynamicPropertyRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -26,4 +30,4 @@ public override string SelectAction(ODataPath odataPath, HttpControllerContext c new WebApiActionMap(actionMap)); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/EntityRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/EntityRoutingConvention.cs index 253cf0cc5d..438251b082 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/EntityRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/EntityRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/EntitySetRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/EntitySetRoutingConvention.cs index f7a5c8dc9a..b3e34b32c7 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/EntitySetRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/EntitySetRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/FunctionRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/FunctionRoutingConvention.cs index 380e0de7c6..cddbe60d69 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/FunctionRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/FunctionRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/IODataRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/IODataRoutingConvention.cs index 7cc67baa1e..0e9e1920fe 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/IODataRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/IODataRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using System.Linq; @@ -32,4 +36,4 @@ public interface IODataRoutingConvention [SuppressMessage("Microsoft.Naming", "CA1704:IdentifiersShouldBeSpelledCorrectly", MessageId = "odata", Justification = "odata is spelled correctly")] string SelectAction(ODataPath odataPath, HttpControllerContext controllerContext, ILookup actionMap); } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/MetadataRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/MetadataRoutingConvention.cs index 54aa07170f..32ef17eb1b 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/MetadataRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/MetadataRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http; @@ -68,4 +72,4 @@ public string SelectAction(ODataPath odataPath, HttpControllerContext controller new WebApiActionMap(actionMap)); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/NavigationRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/NavigationRoutingConvention.cs index 6321f56e2e..b040bb0153 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/NavigationRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/NavigationRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/NavigationSourceRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/NavigationSourceRoutingConvention.cs index c34d857615..853f3e3c52 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/NavigationSourceRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/NavigationSourceRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/ODataRoutingConventions.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/ODataRoutingConventions.cs index 2969f99865..4db3647584 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/ODataRoutingConventions.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/ODataRoutingConventions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Web.Http; @@ -61,4 +65,4 @@ public static IList CreateDefault() }; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/OperationImportRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/OperationImportRoutingConvention.cs index d80829b079..3b672c9261 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/OperationImportRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/OperationImportRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/PropertyRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/PropertyRoutingConvention.cs index 9106aeef75..a8dba30fe0 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/PropertyRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/PropertyRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/RefRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/RefRoutingConvention.cs index b90766a4a9..f27742ee04 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/RefRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/RefRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http.Controllers; @@ -23,4 +27,4 @@ public override string SelectAction(ODataPath odataPath, HttpControllerContext c new WebApiActionMap(actionMap)); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/SingletonRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/SingletonRoutingConvention.cs index 8a34078eff..4342c1e413 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/SingletonRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/SingletonRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/Routing/Conventions/UnmappedRequestRoutingConvention.cs b/src/Microsoft.AspNet.OData/Routing/Conventions/UnmappedRequestRoutingConvention.cs index 042310e1ee..0a3c8819c5 100644 --- a/src/Microsoft.AspNet.OData/Routing/Conventions/UnmappedRequestRoutingConvention.cs +++ b/src/Microsoft.AspNet.OData/Routing/Conventions/UnmappedRequestRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Web.Http.Controllers; diff --git a/src/Microsoft.AspNet.OData/Routing/ODataActionSelector.cs b/src/Microsoft.AspNet.OData/Routing/ODataActionSelector.cs index 7ffc59c5a9..97ed3d8f2e 100644 --- a/src/Microsoft.AspNet.OData/Routing/ODataActionSelector.cs +++ b/src/Microsoft.AspNet.OData/Routing/ODataActionSelector.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Routing/ODataPathParameterBindingAttribute.cs b/src/Microsoft.AspNet.OData/Routing/ODataPathParameterBindingAttribute.cs index dd8cb290c1..3c3c2341e4 100644 --- a/src/Microsoft.AspNet.OData/Routing/ODataPathParameterBindingAttribute.cs +++ b/src/Microsoft.AspNet.OData/Routing/ODataPathParameterBindingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/src/Microsoft.AspNet.OData/Routing/ODataPathRouteConstraint.cs b/src/Microsoft.AspNet.OData/Routing/ODataPathRouteConstraint.cs index a44ce688f8..952f627cb1 100644 --- a/src/Microsoft.AspNet.OData/Routing/ODataPathRouteConstraint.cs +++ b/src/Microsoft.AspNet.OData/Routing/ODataPathRouteConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNet.OData/Routing/ODataRoute.cs b/src/Microsoft.AspNet.OData/Routing/ODataRoute.cs index 305f8e1f5a..6ff0521f22 100644 --- a/src/Microsoft.AspNet.OData/Routing/ODataRoute.cs +++ b/src/Microsoft.AspNet.OData/Routing/ODataRoute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -158,4 +162,4 @@ internal HttpVirtualPathData GenerateLinkDirectly(string odataPath) return new HttpVirtualPathData(this, link); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNet.OData/Routing/ODataValueProviderFactory.cs b/src/Microsoft.AspNet.OData/Routing/ODataValueProviderFactory.cs index bacd3aa7d6..4ded99772e 100644 --- a/src/Microsoft.AspNet.OData/Routing/ODataValueProviderFactory.cs +++ b/src/Microsoft.AspNet.OData/Routing/ODataValueProviderFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Globalization; diff --git a/src/Microsoft.AspNet.OData/Routing/ODataVersionConstraint.cs b/src/Microsoft.AspNet.OData/Routing/ODataVersionConstraint.cs index cf67ab47e0..2012b11d94 100644 --- a/src/Microsoft.AspNet.OData/Routing/ODataVersionConstraint.cs +++ b/src/Microsoft.AspNet.OData/Routing/ODataVersionConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNet.OData/packages.config b/src/Microsoft.AspNet.OData/packages.config index 40a9177be6..6ff30a8060 100644 --- a/src/Microsoft.AspNet.OData/packages.config +++ b/src/Microsoft.AspNet.OData/packages.config @@ -5,10 +5,10 @@ - - + + - + \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiActionDescriptor.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiActionDescriptor.cs index a1d738687a..964d6febcf 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiActionDescriptor.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiActionDescriptor.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -112,7 +116,7 @@ public string ActionName /// A list of attributes of type T. public IEnumerable GetCustomAttributes(bool inherit) where T : Attribute { - return this.innerDescriptor.ControllerTypeInfo.GetCustomAttributes(inherit); + return this.innerDescriptor.MethodInfo.GetCustomAttributes(inherit); } /// diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiActionMap.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiActionMap.cs index 5a10816d61..c726b81885 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiActionMap.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiActionMap.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -43,5 +47,18 @@ public bool Contains(string name) { return this.innerMap.Any(a => String.Equals(a.ActionName, name, StringComparison.InvariantCultureIgnoreCase)); } + + /// + /// Gets the action descriptor of the specified action + /// + /// The name of the action + /// The if it exists, otherwise null + public IWebApiActionDescriptor GetActionDescriptor(string actionName) + { + ControllerActionDescriptor innerDescriptor = this.innerMap.FirstOrDefault( + a => string.Equals(a.ActionName, actionName, StringComparison.InvariantCultureIgnoreCase)); + + return innerDescriptor == null ? null : new WebApiActionDescriptor(innerDescriptor); + } } } diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiAssembliesResolver.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiAssembliesResolver.cs index 253815c9a3..41f66d9028 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiAssembliesResolver.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiAssembliesResolver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiContext.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiContext.cs index 7b013021ec..8534de3028 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiContext.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiControllerContext.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiControllerContext.cs index b89d135d7c..d6f3d7e049 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiControllerContext.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiControllerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiOptions.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiOptions.cs index 6586a6df8f..00864bef67 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiOptions.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Interfaces; diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiRequestHeaders.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiRequestHeaders.cs index 012703f271..2661183066 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiRequestHeaders.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiRequestHeaders.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiRequestMessage.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiRequestMessage.cs index 7e6e93d081..37ed871d57 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiRequestMessage.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiRequestMessage.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Adapters/WebApiUrlHelper.cs b/src/Microsoft.AspNetCore.OData/Adapters/WebApiUrlHelper.cs index 43618fffe6..9b84800ce0 100644 --- a/src/Microsoft.AspNetCore.OData/Adapters/WebApiUrlHelper.cs +++ b/src/Microsoft.AspNetCore.OData/Adapters/WebApiUrlHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Batch/ChangeSetRequestItem.cs b/src/Microsoft.AspNetCore.OData/Batch/ChangeSetRequestItem.cs index e8becc8c57..09991f698b 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ChangeSetRequestItem.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ChangeSetRequestItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Threading.Tasks; @@ -68,4 +72,4 @@ public override async Task SendRequestAsync(RequestDeleg return new ChangeSetResponseItem(responseContexts); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/ChangeSetResponseItem.cs b/src/Microsoft.AspNetCore.OData/Batch/ChangeSetResponseItem.cs index 0b4d1619d3..f607b9ac1f 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ChangeSetResponseItem.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ChangeSetResponseItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -79,4 +83,4 @@ internal override bool IsResponseSuccessful() return Contexts.All(c => c.Response.IsSuccessStatusCode()); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/DefaultODataBatchHandler.cs b/src/Microsoft.AspNetCore.OData/Batch/DefaultODataBatchHandler.cs index ec2821edd7..de7da25058 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/DefaultODataBatchHandler.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/DefaultODataBatchHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -134,4 +138,4 @@ public virtual async Task> ParseBatchRequestsAsync( return requests; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/HttpRequestExtensions.cs b/src/Microsoft.AspNetCore.OData/Batch/HttpRequestExtensions.cs index e27e8828e7..e907ae500c 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/HttpRequestExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/HttpRequestExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel; @@ -93,4 +97,4 @@ public static void CopyBatchRequestProperties(this HttpRequest subRequest, HttpR } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchContent.cs b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchContent.cs index 0935925a30..571e055f41 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchContent.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchContent.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -72,4 +76,4 @@ public Task SerializeToStreamAsync(Stream stream) return WriteToResponseMessageAsync(responseMessage); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchHandler.cs b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchHandler.cs index f02dd6b5b1..d1bd7f985c 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchHandler.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -79,4 +83,4 @@ public virtual Uri GetBaseUri(HttpRequest request) return request.GetODataBatchBaseUri(ODataRouteName, ODataRoute); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchHttpRequestMessageExtensions.cs b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchHttpRequestMessageExtensions.cs index 874bbf445c..b5fa57bdf3 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchHttpRequestMessageExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchHttpRequestMessageExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchMiddleware.cs b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchMiddleware.cs index 4e295fdd9e..7aa5323db7 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchMiddleware.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchMiddleware.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchPathMapping.cs b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchPathMapping.cs index 3beaf094e7..72b38caf66 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchPathMapping.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchPathMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchReaderExtensions.cs b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchReaderExtensions.cs index e054e0fa57..4c12694a16 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchReaderExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchReaderExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -393,4 +397,4 @@ private static IEnumerable SplitPreferences(string preferences) } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchRequestItem.cs b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchRequestItem.cs index 188788b41c..d895965bd4 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchRequestItem.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchRequestItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -93,4 +97,4 @@ private static void AddLocationHeaderToMapping( /// A . public abstract Task SendRequestAsync(RequestDelegate handler); } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchResponseItem.cs b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchResponseItem.cs index 09cec3f994..30da741d33 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchResponseItem.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchResponseItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchStream.cs b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchStream.cs index b6e2326058..43ef7f26b5 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/ODataBatchStream.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/ODataBatchStream.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.IO; using System.Threading.Tasks; @@ -50,4 +54,4 @@ public override void Close() { } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/OperationRequestItem.cs b/src/Microsoft.AspNetCore.OData/Batch/OperationRequestItem.cs index c5cc1262b8..525b7c33bf 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/OperationRequestItem.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/OperationRequestItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Threading.Tasks; using Microsoft.AspNet.OData.Common; @@ -47,4 +51,4 @@ public override async Task SendRequestAsync(RequestDeleg return new OperationResponseItem(Context); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/OperationResponseItem.cs b/src/Microsoft.AspNetCore.OData/Batch/OperationResponseItem.cs index 896a508ff0..335d30bb60 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/OperationResponseItem.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/OperationResponseItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Threading.Tasks; using Microsoft.AspNet.OData.Common; @@ -56,4 +60,4 @@ internal override bool IsResponseSuccessful() return Context.Response.IsSuccessStatusCode(); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Batch/UnbufferedODataBatchHandler.cs b/src/Microsoft.AspNetCore.OData/Batch/UnbufferedODataBatchHandler.cs index 3d08c775c6..4ff47b4043 100644 --- a/src/Microsoft.AspNetCore.OData/Batch/UnbufferedODataBatchHandler.cs +++ b/src/Microsoft.AspNetCore.OData/Batch/UnbufferedODataBatchHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -166,4 +170,4 @@ public virtual async Task ExecuteChangeSetAsync(ODataBat return new ChangeSetResponseItem(changeSetResponse); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Builder/ODataConventionModelBuilder.cs b/src/Microsoft.AspNetCore.OData/Builder/ODataConventionModelBuilder.cs index 1cb243cdc2..49e22c817d 100644 --- a/src/Microsoft.AspNetCore.OData/Builder/ODataConventionModelBuilder.cs +++ b/src/Microsoft.AspNetCore.OData/Builder/ODataConventionModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/ETagMessageHandler.cs b/src/Microsoft.AspNetCore.OData/ETagMessageHandler.cs index 66cac21f03..c05dd454ef 100644 --- a/src/Microsoft.AspNetCore.OData/ETagMessageHandler.cs +++ b/src/Microsoft.AspNetCore.OData/ETagMessageHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http.Headers; diff --git a/src/Microsoft.AspNetCore.OData/EnableNestedPathsAttribute.cs b/src/Microsoft.AspNetCore.OData/EnableNestedPathsAttribute.cs new file mode 100644 index 0000000000..437966d0e7 --- /dev/null +++ b/src/Microsoft.AspNetCore.OData/EnableNestedPathsAttribute.cs @@ -0,0 +1,147 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq; +using System.Reflection; +using Microsoft.AspNet.OData.Adapters; +using Microsoft.AspNet.OData.Common; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Query; +using Microsoft.AspNet.OData.Routing; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.OData.Edm; + +namespace Microsoft.AspNet.OData +{ + /// + /// This class defines an attribute that can be applied to an action to allow handling + /// of arbitrarily nested paths. The result of the action should be an IQueryable + /// or SingleResult. The sequence of property and key accesses in the path will be + /// applied to the result of the action through query transformations. + /// + [AttributeUsage(AttributeTargets.Method, AllowMultiple = false)] + public sealed class EnableNestedPathsAttribute : ActionFilterAttribute + { + /// + public EnableNestedPathsAttribute(): base() + { + // ensures this filter is executed before [EnableQuery] which has default order 0 + // since the OnActionExecuted method is executed after the action, + // a filter with a lower order will be executed after a filter with a higher order + Order = 1; + } + + /// + /// Transforms the result of the action based on the sequence of property accesses in the odata path + /// after the action is executed. + /// It first tries to retrieve the IQueryable from the + /// returning response message. It then uses the to transform + /// the query and sets the result back to the response message. + /// + /// The context related to this action, including the response message, + /// request message and HttpConfiguration etc. + public override void OnActionExecuted(ActionExecutedContext actionExecutedContext) + { + if (actionExecutedContext == null) + { + throw Error.ArgumentNull("actionExecutedContext"); + } + + HttpRequest request = actionExecutedContext.HttpContext.Request; + if (request == null) + { + throw Error.Argument("actionExecutedContext", SRResources.ActionExecutedContextMustHaveRequest); + } + + ControllerActionDescriptor actionDescriptor = actionExecutedContext.ActionDescriptor as ControllerActionDescriptor; + if (actionDescriptor == null) + { + throw Error.Argument("actionExecutedContext", SRResources.ActionContextMustHaveDescriptor); + } + + HttpResponse response = actionExecutedContext.HttpContext.Response; + + ObjectResult responseContent = actionExecutedContext.Result as ObjectResult; + IQueryable result = responseContent.Value as IQueryable; + SingleResult singleResult = responseContent.Value as SingleResult; + if (singleResult != null) + { + // This could be a SingleResult, which has the property Queryable. + // But it could be a SingleResult() or SingleResult. Sort by number of parameters + // on the property and get the one with the most parameters. + PropertyInfo propInfo = singleResult.GetType().GetProperties() + .Where(p => p.Name.Equals("Queryable")) + .OrderByDescending(p => p.GetIndexParameters().Count()) + .FirstOrDefault(); + + result = propInfo.GetValue(singleResult) as IQueryable; + } + + if (result != null) + { + ODataPath path = actionExecutedContext.HttpContext.ODataFeature().Path; + IEdmModel model = actionExecutedContext.HttpContext.Request.GetModel(); + + var queryBuilder = new ODataPathQueryBuilder(result, path); + ODataPathQueryResult transformedResult = queryBuilder.BuildQuery(); + + if (transformedResult == null) + { + actionExecutedContext.Result = new NotFoundObjectResult(null); + } + else if (path.EdmType.TypeKind == EdmTypeKind.Collection || transformedResult.HasCountSegment) + { + responseContent.Value = transformedResult.Result; + } + else + { + Type elementType = transformedResult.Result.ElementType; + + // If we return the IQueryable as the result, then the response will be returned as a collection + // so we have to return a single result. We can either return the materialized single result using SingleOrDefault, + // which will run the query against the underlying data source. Or we can wrap the IQueryable result with + // a SingleResult. + // If the action has [EnableQuery], then we return a SingleResult which allows query options to be + // applied to the IQueryable. If we returned the materialized object, then query options like $expand + // would return null because navigation properties are not fetched from relational databases by default. + // If the action does not have [EnableQuery], then we run the query using SingleOrDefault and return the + // actual object. If we returned a SingleResult in this case, we'd get an error because the serializer + // does not recognize it. + if (actionDescriptor.MethodInfo.GetCustomAttributes().Any()) + { + // calls SingleResult.Create(IQueryable) + responseContent.Value = ExpressionHelpers.CreateSingleResult(transformedResult.Result, transformedResult.Result.ElementType); + } + else + { + try + { + object singleValue = QueryHelpers.SingleOrDefault(transformedResult.Result, new WebApiActionDescriptor(actionDescriptor)); + + if (singleValue == null) + { + actionExecutedContext.Result = new NotFoundObjectResult(null); + } + else + { + responseContent.Value = singleValue; + } + } + catch (NullReferenceException) + { + actionExecutedContext.Result = new NotFoundObjectResult(null); + } + } + } + } + } + } +} diff --git a/src/Microsoft.AspNetCore.OData/EnableQueryAttribute.cs b/src/Microsoft.AspNetCore.OData/EnableQueryAttribute.cs index c96e862503..480fc975d8 100644 --- a/src/Microsoft.AspNetCore.OData/EnableQueryAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/EnableQueryAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -140,7 +144,7 @@ public override void OnActionExecuting(ActionExecutingContext context) { elementType = TypeHelper.GetImplementedIEnumerableType(returnType); } - else if(TypeHelper.IsGenericType(returnType) && returnType.GetGenericTypeDefinition() == typeof(Task<>)) + else if (TypeHelper.IsGenericType(returnType) && returnType.GetGenericTypeDefinition() == typeof(Task<>)) { elementType = returnType.GetGenericArguments().First(); } @@ -228,46 +232,44 @@ public override void OnActionExecuted(ActionExecutedContext actionExecutedContex { // actionExecutedContext.Result might also indicate a status code that has not yet // been applied to the result; make sure it's also successful. - StatusCodeResult statusCodeResult = actionExecutedContext.Result as StatusCodeResult; - if (statusCodeResult == null || IsSuccessStatusCode(statusCodeResult.StatusCode)) + ObjectResult responseContent = actionExecutedContext.Result as ObjectResult; + + if (responseContent != null && (responseContent.StatusCode == null || IsSuccessStatusCode(responseContent.StatusCode.Value))) { - ObjectResult responseContent = actionExecutedContext.Result as ObjectResult; - if (responseContent != null) + + //throw Error.Argument("actionExecutedContext", SRResources.QueryingRequiresObjectContent, + // actionExecutedContext.Result.GetType().FullName); + + // Get collection from SingleResult. + IQueryable singleResultCollection = null; + SingleResult singleResult = responseContent.Value as SingleResult; + if (singleResult != null) + { + // This could be a SingleResult, which has the property Queryable. + // But it could be a SingleResult() or SingleResult. Sort by number of parameters + // on the property and get the one with the most parameters. + PropertyInfo propInfo = responseContent.Value.GetType().GetProperties() + .OrderBy(p => p.GetIndexParameters().Count()) + .Where(p => p.Name.Equals("Queryable")) + .LastOrDefault(); + + singleResultCollection = propInfo.GetValue(singleResult) as IQueryable; + } + + // Execution the action. + object queryResult = OnActionExecuted( + responseContent.Value, + singleResultCollection, + new WebApiActionDescriptor(actionDescriptor as ControllerActionDescriptor), + new WebApiRequestMessage(request), + (elementClrType) => GetModel(elementClrType, request, actionDescriptor), + (queryContext) => CreateAndValidateQueryOptions(request, queryContext), + (statusCode) => actionExecutedContext.Result = new StatusCodeResult((int)statusCode), + (statusCode, message, exception) => actionExecutedContext.Result = CreateBadRequestResult(message, exception)); + + if (queryResult != null) { - //throw Error.Argument("actionExecutedContext", SRResources.QueryingRequiresObjectContent, - // actionExecutedContext.Result.GetType().FullName); - - // Get collection from SingleResult. - IQueryable singleResultCollection = null; - SingleResult singleResult = responseContent.Value as SingleResult; - if (singleResult != null) - { - // This could be a SingleResult, which has the property Queryable. - // But it could be a SingleResult() or SingleResult. Sort by number of parameters - // on the property and get the one with the most parameters. - PropertyInfo propInfo = responseContent.Value.GetType().GetProperties() - .OrderBy(p => p.GetIndexParameters().Count()) - .Where(p => p.Name.Equals("Queryable")) - .LastOrDefault(); - - singleResultCollection = propInfo.GetValue(singleResult) as IQueryable; - } - - // Execution the action. - object queryResult = OnActionExecuted( - responseContent.Value, - singleResultCollection, - new WebApiActionDescriptor(actionDescriptor as ControllerActionDescriptor), - new WebApiRequestMessage(request), - (elementClrType) => GetModel(elementClrType, request, actionDescriptor), - (queryContext) => CreateAndValidateQueryOptions(request, queryContext), - (statusCode) => actionExecutedContext.Result = new StatusCodeResult((int)statusCode), - (statusCode, message, exception) => actionExecutedContext.Result = CreateBadRequestResult(message, exception)); - - if (queryResult != null) - { - responseContent.Value = queryResult; - } + responseContent.Value = queryResult; } } } @@ -436,4 +438,4 @@ private class RequestQueryData public ODataQueryOptions ProcessedQueryOptions { get; set; } } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Extensions/ActionDescriptorExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/ActionDescriptorExtensions.cs index b89211fba1..1f1d8578d4 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/ActionDescriptorExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/ActionDescriptorExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointBuilderExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointBuilderExtensions.cs index 9d2f36ccd1..9acb537884 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointBuilderExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETSTANDARD2_0 using System; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointLinkGenerator.cs b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointLinkGenerator.cs index e05c0aff93..e0e2e7bf3b 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointLinkGenerator.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointLinkGenerator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETSTANDARD2_0 using System; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointPattern.cs b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointPattern.cs index ea992c216a..a91a4864b0 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointPattern.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointPattern.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETSTANDARD2_0 using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointRouteValueTransformer.cs b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointRouteValueTransformer.cs index e6a4c1b8eb..f83b886fb5 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointRouteValueTransformer.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointRouteValueTransformer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETSTANDARD2_0 using System; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointSelectorPolicy.cs b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointSelectorPolicy.cs index dd5d1a408b..430fe05fe5 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointSelectorPolicy.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/Endpoint/ODataEndpointSelectorPolicy.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETSTANDARD2_0 using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/HttpContextExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/HttpContextExtensions.cs index 573de8140d..82f9b2da2d 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/HttpContextExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/HttpContextExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Formatter; @@ -95,4 +99,4 @@ public static IETagHandler GetETagHandler(this HttpContext httpContext) return httpContext.RequestServices.GetRequiredService(); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Extensions/HttpRequestExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/HttpRequestExtensions.cs index 5127082ff8..2ebc3d8ff5 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/HttpRequestExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/HttpRequestExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -524,4 +528,4 @@ private static IServiceScope CreateRequestScope(this HttpRequest request, string return scope; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Extensions/HttpResponseExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/HttpResponseExtensions.cs index 9993a959ef..2d15f19cb1 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/HttpResponseExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/HttpResponseExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNetCore.Http; @@ -20,4 +24,4 @@ public static bool IsSuccessStatusCode(this HttpResponse response) return response?.StatusCode >= 200 && response.StatusCode < 300; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Extensions/ODataApplicationBuilderExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/ODataApplicationBuilderExtensions.cs index c9f75ca3da..c1138ef8fa 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/ODataApplicationBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/ODataApplicationBuilderExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Batch; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/ODataRouteBuilderExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/ODataRouteBuilderExtensions.cs index fad53b0a37..8d84bcf30e 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/ODataRouteBuilderExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/ODataRouteBuilderExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/ODataServiceCollectionExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/ODataServiceCollectionExtensions.cs index 0fbad56a80..a69ce647c2 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/ODataServiceCollectionExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/ODataServiceCollectionExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/ODataServiceProviderConfigExtenions.cs b/src/Microsoft.AspNetCore.OData/Extensions/ODataServiceProviderConfigExtenions.cs index 605c5f76e6..7819a3f68d 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/ODataServiceProviderConfigExtenions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/ODataServiceProviderConfigExtenions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/SerializableErrorExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/SerializableErrorExtensions.cs index c23065518a..c0faab0d67 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/SerializableErrorExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/SerializableErrorExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Extensions/UrlHelperExtensions.cs b/src/Microsoft.AspNetCore.OData/Extensions/UrlHelperExtensions.cs index 0c9790dbc4..e36aacdf33 100644 --- a/src/Microsoft.AspNetCore.OData/Extensions/UrlHelperExtensions.cs +++ b/src/Microsoft.AspNetCore.OData/Extensions/UrlHelperExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/DefaultODataDeserializerProvider.cs b/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/DefaultODataDeserializerProvider.cs index 82183b6658..1ade18b575 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/DefaultODataDeserializerProvider.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/DefaultODataDeserializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Extensions; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/ODataDeserializerContext.cs b/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/ODataDeserializerContext.cs index 0106cfba72..0b89fbebd9 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/ODataDeserializerContext.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/ODataDeserializerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Adapters; using Microsoft.AspNet.OData.Extensions; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/ODataDeserializerProvider.cs b/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/ODataDeserializerProvider.cs index 1fcb9202cc..f6dd6b5642 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/ODataDeserializerProvider.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/Deserialization/ODataDeserializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNetCore.Http; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/IMediaTypeMappingCollection.cs b/src/Microsoft.AspNetCore.OData/Formatter/IMediaTypeMappingCollection.cs index 736c9667f2..a84650cc47 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/IMediaTypeMappingCollection.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/IMediaTypeMappingCollection.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/MediaTypeMapping.cs b/src/Microsoft.AspNetCore.OData/Formatter/MediaTypeMapping.cs index 9fd2631cad..389df22194 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/MediaTypeMapping.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/MediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http.Headers; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/ODataCountMediaTypeMapping.cs b/src/Microsoft.AspNetCore.OData/Formatter/ODataCountMediaTypeMapping.cs index b0e7768113..d9d24926a2 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/ODataCountMediaTypeMapping.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/ODataCountMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Extensions; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/ODataInputFormatter.cs b/src/Microsoft.AspNetCore.OData/Formatter/ODataInputFormatter.cs index a1c45332dd..2418186209 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/ODataInputFormatter.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/ODataInputFormatter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -238,4 +242,4 @@ internal static ODataVersion GetODataResponseVersion(HttpRequest request) ODataVersionConstraint.DefaultODataVersion; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Formatter/ODataInputFormatterFactory.cs b/src/Microsoft.AspNetCore.OData/Formatter/ODataInputFormatterFactory.cs index 2b1a09c8f8..2a639a4040 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/ODataInputFormatterFactory.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/ODataInputFormatterFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Text; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/ODataModelBinder.cs b/src/Microsoft.AspNetCore.OData/Formatter/ODataModelBinder.cs index 15936f7925..8d2dcdc646 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/ODataModelBinder.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/ODataModelBinder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/ODataOutputFormatter.cs b/src/Microsoft.AspNetCore.OData/Formatter/ODataOutputFormatter.cs index 84e608ada5..b427bebb71 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/ODataOutputFormatter.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/ODataOutputFormatter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -473,4 +477,4 @@ public override string ToString() return this.stream.ToString(); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Formatter/ODataOutputFormatterFactory.cs b/src/Microsoft.AspNetCore.OData/Formatter/ODataOutputFormatterFactory.cs index 8b15b58b04..af9bb037d9 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/ODataOutputFormatterFactory.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/ODataOutputFormatterFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Text; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/ODataRawValueMediaTypeMapping.cs b/src/Microsoft.AspNetCore.OData/Formatter/ODataRawValueMediaTypeMapping.cs index 71ce897bc5..c402048397 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/ODataRawValueMediaTypeMapping.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/ODataRawValueMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Extensions; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/ODataStreamMediaTypeMapping.cs b/src/Microsoft.AspNetCore.OData/Formatter/ODataStreamMediaTypeMapping.cs index ed6cb77e25..96d2326d78 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/ODataStreamMediaTypeMapping.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/ODataStreamMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Extensions; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/QueryStringMediaTypeMapping.cs b/src/Microsoft.AspNetCore.OData/Formatter/QueryStringMediaTypeMapping.cs index dd4bc13a97..e316ce953a 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/QueryStringMediaTypeMapping.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/QueryStringMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/DefaultODataSerializerProvider.cs b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/DefaultODataSerializerProvider.cs index d17afbad1e..2877dc4d76 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/DefaultODataSerializerProvider.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/DefaultODataSerializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Extensions; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataErrorSerializer.cs b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataErrorSerializer.cs index 1fae777f30..707b507b12 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataErrorSerializer.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataErrorSerializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNetCore.Mvc; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataSerializerContext.cs b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataSerializerContext.cs index 21bf0e6209..4aece06197 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataSerializerContext.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataSerializerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Adapters; using Microsoft.AspNet.OData.Extensions; diff --git a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataSerializerProvider.cs b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataSerializerProvider.cs index 4047ad996e..5a27f59623 100644 --- a/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataSerializerProvider.cs +++ b/src/Microsoft.AspNetCore.OData/Formatter/Serialization/ODataSerializerProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNetCore.Http; diff --git a/src/Microsoft.AspNetCore.OData/FromODataUriAttribute.cs b/src/Microsoft.AspNetCore.OData/FromODataUriAttribute.cs index 664f9b9a23..69feb02b92 100644 --- a/src/Microsoft.AspNetCore.OData/FromODataUriAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/FromODataUriAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Formatter; diff --git a/src/Microsoft.AspNetCore.OData/GetNextPageHelper.cs b/src/Microsoft.AspNetCore.OData/GetNextPageHelper.cs index 4520b25a9d..aa1b017278 100644 --- a/src/Microsoft.AspNetCore.OData/GetNextPageHelper.cs +++ b/src/Microsoft.AspNetCore.OData/GetNextPageHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/HttpRequestScope.cs b/src/Microsoft.AspNetCore.OData/HttpRequestScope.cs index 85b1ca8709..a61a520620 100644 --- a/src/Microsoft.AspNetCore.OData/HttpRequestScope.cs +++ b/src/Microsoft.AspNetCore.OData/HttpRequestScope.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNetCore.Http; diff --git a/src/Microsoft.AspNetCore.OData/Interfaces/IODataBatchFeature.cs b/src/Microsoft.AspNetCore.OData/Interfaces/IODataBatchFeature.cs index caea855716..bec8e93085 100644 --- a/src/Microsoft.AspNetCore.OData/Interfaces/IODataBatchFeature.cs +++ b/src/Microsoft.AspNetCore.OData/Interfaces/IODataBatchFeature.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Interfaces/IODataCoreBuilder.cs b/src/Microsoft.AspNetCore.OData/Interfaces/IODataCoreBuilder.cs index 46a840b265..eac955f25f 100644 --- a/src/Microsoft.AspNetCore.OData/Interfaces/IODataCoreBuilder.cs +++ b/src/Microsoft.AspNetCore.OData/Interfaces/IODataCoreBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.Extensions.DependencyInjection; diff --git a/src/Microsoft.AspNetCore.OData/Interfaces/IODataFeature.cs b/src/Microsoft.AspNetCore.OData/Interfaces/IODataFeature.cs index 801a17ad72..3d4e00ea0f 100644 --- a/src/Microsoft.AspNetCore.OData/Interfaces/IODataFeature.cs +++ b/src/Microsoft.AspNetCore.OData/Interfaces/IODataFeature.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Nightly.Release.nuspec b/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Nightly.nuspec similarity index 83% rename from src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Nightly.Release.nuspec rename to src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Nightly.nuspec index 9432a268a1..8d390167c5 100644 --- a/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Nightly.Release.nuspec +++ b/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Nightly.nuspec @@ -3,17 +3,18 @@ Microsoft.AspNetCore.OData Microsoft ASP.NET Core 2.0 and 3.x for OData v4.0 - $VersionFullSemantic$-Nightly$NightlyBuildVersion$ - Microsoft - © Microsoft Corporation. All rights reserved. + $VersionNuGetSemantic$-Nightly$NightlyBuildVersion$ + OData (.NET Foundation) + © .NET Foundation and Contributors. All rights reserved. This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC and to support OData query syntax for your web APIs. This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC. en-US http://odata.github.io - https://raw.githubusercontent.com/OData/WebApi/master/License.txt + MIT true Microsoft AspNetCore WebApi OData - http://static.tumblr.com/hgchgxz/9ualgdf98/icon.png + images\odata.png + @@ -35,5 +36,6 @@ + \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Release.nuspec b/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Release.nuspec index 9319501215..d7c2195ec5 100644 --- a/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Release.nuspec +++ b/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.Release.nuspec @@ -4,17 +4,18 @@ Microsoft.AspNetCore.OData Microsoft ASP.NET Core 2.0 and 3.x for OData v4.0 $VersionNuGetSemantic$ - Microsoft - © Microsoft Corporation. All rights reserved. + OData (.NET Foundation) + © .NET Foundation and Contributors. All rights reserved. This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC and to support OData query syntax for your web APIs. This package contains everything you need to create OData v4.0 endpoints using ASP.NET Core MVC. https://docs.microsoft.com/en-us/odata/changelog/webapi-7x en-US http://odata.github.io - https://raw.githubusercontent.com/OData/WebApi/master/License.txt + MIT true Microsoft AspNetCore WebApi OData - http://static.tumblr.com/hgchgxz/9ualgdf98/icon.png + images\odata.png + @@ -36,5 +37,6 @@ + \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.csproj b/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.csproj index d022b17221..bc5948571b 100644 --- a/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.csproj +++ b/src/Microsoft.AspNetCore.OData/Microsoft.AspNetCore.OData.csproj @@ -41,9 +41,9 @@ - - - + + + all runtime; build; native; contentfiles; analyzers; buildtransitive @@ -80,4 +80,15 @@ SRResources.resx + + + ProductRoot=$(ProductBinPath);VersionNuGetSemantic=$(VersionNuGetSemantic) + $(NuspecProperties);NightlyBuildVersion=$(NightlyBuildVersion) + $(NuspecProperties);SourcesRoot=$(RootDir) + $(NuspecProperties);AspNetCorePackageDependency=$(AspNetCorePackageDependency) + $(NuspecProperties);DependencyInjection2PackageDependency=$(DependencyInjection2PackageDependency) + $(NuspecProperties);ODataLibPackageDependency=$(ODataLibPackageDependency) + $(NuspecProperties);NewtonsoftJsonPackageDependency=$(NewtonsoftJsonPackageDependency) + + diff --git a/src/Microsoft.AspNetCore.OData/NonValidatingParameterBindingAttribute.cs b/src/Microsoft.AspNetCore.OData/NonValidatingParameterBindingAttribute.cs index a72736d1fb..02148cc867 100644 --- a/src/Microsoft.AspNetCore.OData/NonValidatingParameterBindingAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/NonValidatingParameterBindingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; diff --git a/src/Microsoft.AspNetCore.OData/ODataBatchFeature.cs b/src/Microsoft.AspNetCore.OData/ODataBatchFeature.cs index 215b3057b8..3cb4d4f090 100644 --- a/src/Microsoft.AspNetCore.OData/ODataBatchFeature.cs +++ b/src/Microsoft.AspNetCore.OData/ODataBatchFeature.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/ODataController.cs b/src/Microsoft.AspNetCore.OData/ODataController.cs index c59374c8c6..81f474a7c4 100644 --- a/src/Microsoft.AspNetCore.OData/ODataController.cs +++ b/src/Microsoft.AspNetCore.OData/ODataController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Results; diff --git a/src/Microsoft.AspNetCore.OData/ODataFeature.cs b/src/Microsoft.AspNetCore.OData/ODataFeature.cs index 225389920b..7fb2add0f9 100644 --- a/src/Microsoft.AspNetCore.OData/ODataFeature.cs +++ b/src/Microsoft.AspNetCore.OData/ODataFeature.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/ODataFormattingAttribute.cs b/src/Microsoft.AspNetCore.OData/ODataFormattingAttribute.cs index 2e4dedf9a1..abe0042cb2 100644 --- a/src/Microsoft.AspNetCore.OData/ODataFormattingAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/ODataFormattingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNetCore.OData/ODataMessageWrapperHelper.cs b/src/Microsoft.AspNetCore.OData/ODataMessageWrapperHelper.cs index 5b9c2b5dba..58a45abd25 100644 --- a/src/Microsoft.AspNetCore.OData/ODataMessageWrapperHelper.cs +++ b/src/Microsoft.AspNetCore.OData/ODataMessageWrapperHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/ODataNullValueMessageHandler.cs b/src/Microsoft.AspNetCore.OData/ODataNullValueMessageHandler.cs index 6cfacdc184..1319b25565 100644 --- a/src/Microsoft.AspNetCore.OData/ODataNullValueMessageHandler.cs +++ b/src/Microsoft.AspNetCore.OData/ODataNullValueMessageHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/src/Microsoft.AspNetCore.OData/ODataOptions.cs b/src/Microsoft.AspNetCore.OData/ODataOptions.cs index ba8f5508d8..2d9d2467db 100644 --- a/src/Microsoft.AspNetCore.OData/ODataOptions.cs +++ b/src/Microsoft.AspNetCore.OData/ODataOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData; diff --git a/src/Microsoft.AspNetCore.OData/ODataQueryParameterBindingAttribute.cs b/src/Microsoft.AspNetCore.OData/ODataQueryParameterBindingAttribute.cs index 7654037921..f0afb267c4 100644 --- a/src/Microsoft.AspNetCore.OData/ODataQueryParameterBindingAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/ODataQueryParameterBindingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/src/Microsoft.AspNetCore.OData/ODataRoutingAttribute.cs b/src/Microsoft.AspNetCore.OData/ODataRoutingAttribute.cs index d2de8401f8..e9fefdc1b4 100644 --- a/src/Microsoft.AspNetCore.OData/ODataRoutingAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/ODataRoutingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -13,4 +17,4 @@ public sealed class ODataRoutingAttribute : Attribute { // This class is not needed; Routing is injected in ODataServiceCollectionExtensions::AddOdata() } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/ODataServiceBuilder.cs b/src/Microsoft.AspNetCore.OData/ODataServiceBuilder.cs index 641b28924f..a6ca174165 100644 --- a/src/Microsoft.AspNetCore.OData/ODataServiceBuilder.cs +++ b/src/Microsoft.AspNetCore.OData/ODataServiceBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Interfaces; diff --git a/src/Microsoft.AspNetCore.OData/ODataValueProviderFactory.cs b/src/Microsoft.AspNetCore.OData/ODataValueProviderFactory.cs index 3c6c528d15..6d058d702d 100644 --- a/src/Microsoft.AspNetCore.OData/ODataValueProviderFactory.cs +++ b/src/Microsoft.AspNetCore.OData/ODataValueProviderFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/PerRouteContainer.cs b/src/Microsoft.AspNetCore.OData/PerRouteContainer.cs index c6930cad13..6b0f9d53f2 100644 --- a/src/Microsoft.AspNetCore.OData/PerRouteContainer.cs +++ b/src/Microsoft.AspNetCore.OData/PerRouteContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Concurrent; diff --git a/src/Microsoft.AspNetCore.OData/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.OData/Properties/AssemblyInfo.cs index 70c522383d..e09883cfac 100644 --- a/src/Microsoft.AspNetCore.OData/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.OData/Properties/AssemblyInfo.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; using System.Runtime.CompilerServices; @@ -7,4 +11,4 @@ [assembly: AssemblyTitle("Microsoft.AspNetCore.OData")] [assembly: AssemblyDescription("")] -[assembly: InternalsVisibleTo("Microsoft.AspNetCore.OData.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] \ No newline at end of file +[assembly: InternalsVisibleTo("Microsoft.AspNetCore.OData.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] diff --git a/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptions.cs b/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptions.cs index bb23365a9a..7d4fbbd1b5 100644 --- a/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptions.cs +++ b/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptionsOfTEntity.cs b/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptionsOfTEntity.cs index b08648058a..2f64deb51a 100644 --- a/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptionsOfTEntity.cs +++ b/src/Microsoft.AspNetCore.OData/Query/ODataQueryOptionsOfTEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Common; using Microsoft.AspNetCore.Http; diff --git a/src/Microsoft.AspNetCore.OData/Query/PlainTextODataQueryOptionsParser.cs b/src/Microsoft.AspNetCore.OData/Query/PlainTextODataQueryOptionsParser.cs index 7485d23b9f..368c1a238f 100644 --- a/src/Microsoft.AspNetCore.OData/Query/PlainTextODataQueryOptionsParser.cs +++ b/src/Microsoft.AspNetCore.OData/Query/PlainTextODataQueryOptionsParser.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNetCore.OData/Query/QueryFilterProvider.cs b/src/Microsoft.AspNetCore.OData/Query/QueryFilterProvider.cs index 0d48649c55..ed63017721 100644 --- a/src/Microsoft.AspNetCore.OData/Query/QueryFilterProvider.cs +++ b/src/Microsoft.AspNetCore.OData/Query/QueryFilterProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/src/Microsoft.AspNetCore.OData/ResourceContext.cs b/src/Microsoft.AspNetCore.OData/ResourceContext.cs index d54d72a6a4..223c7a3dd2 100644 --- a/src/Microsoft.AspNetCore.OData/ResourceContext.cs +++ b/src/Microsoft.AspNetCore.OData/ResourceContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNetCore.Http; diff --git a/src/Microsoft.AspNetCore.OData/ResourceSetContext.cs b/src/Microsoft.AspNetCore.OData/ResourceSetContext.cs index d7a99133c1..f5163301d2 100644 --- a/src/Microsoft.AspNetCore.OData/ResourceSetContext.cs +++ b/src/Microsoft.AspNetCore.OData/ResourceSetContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Results/BadRequestODataResult.cs b/src/Microsoft.AspNetCore.OData/Results/BadRequestODataResult.cs index 592760c48e..9f6fee3eb0 100644 --- a/src/Microsoft.AspNetCore.OData/Results/BadRequestODataResult.cs +++ b/src/Microsoft.AspNetCore.OData/Results/BadRequestODataResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; diff --git a/src/Microsoft.AspNetCore.OData/Results/ConflictODataResult.cs b/src/Microsoft.AspNetCore.OData/Results/ConflictODataResult.cs index 83455aa313..330a58b6cb 100644 --- a/src/Microsoft.AspNetCore.OData/Results/ConflictODataResult.cs +++ b/src/Microsoft.AspNetCore.OData/Results/ConflictODataResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETSTANDARD2_0 using System.Threading.Tasks; diff --git a/src/Microsoft.AspNetCore.OData/Results/CreatedODataResult.cs b/src/Microsoft.AspNetCore.OData/Results/CreatedODataResult.cs index 6f6852858a..683d587405 100644 --- a/src/Microsoft.AspNetCore.OData/Results/CreatedODataResult.cs +++ b/src/Microsoft.AspNetCore.OData/Results/CreatedODataResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net; diff --git a/src/Microsoft.AspNetCore.OData/Results/IODataErrorResult.cs b/src/Microsoft.AspNetCore.OData/Results/IODataErrorResult.cs index 17c42a59b1..75a5783137 100644 --- a/src/Microsoft.AspNetCore.OData/Results/IODataErrorResult.cs +++ b/src/Microsoft.AspNetCore.OData/Results/IODataErrorResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData; diff --git a/src/Microsoft.AspNetCore.OData/Results/NotFoundODataResult.cs b/src/Microsoft.AspNetCore.OData/Results/NotFoundODataResult.cs index d3634c74d1..666455df53 100644 --- a/src/Microsoft.AspNetCore.OData/Results/NotFoundODataResult.cs +++ b/src/Microsoft.AspNetCore.OData/Results/NotFoundODataResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; diff --git a/src/Microsoft.AspNetCore.OData/Results/ODataErrorResult.cs b/src/Microsoft.AspNetCore.OData/Results/ODataErrorResult.cs index 938866689e..40fb919227 100644 --- a/src/Microsoft.AspNetCore.OData/Results/ODataErrorResult.cs +++ b/src/Microsoft.AspNetCore.OData/Results/ODataErrorResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNetCore.OData/Results/ResultHelpers.cs b/src/Microsoft.AspNetCore.OData/Results/ResultHelpers.cs index f337f2b00c..18ba2cf19a 100644 --- a/src/Microsoft.AspNetCore.OData/Results/ResultHelpers.cs +++ b/src/Microsoft.AspNetCore.OData/Results/ResultHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/src/Microsoft.AspNetCore.OData/Results/UnauthorizedODataResult.cs b/src/Microsoft.AspNetCore.OData/Results/UnauthorizedODataResult.cs index cfa7c1706a..f7dc424249 100644 --- a/src/Microsoft.AspNetCore.OData/Results/UnauthorizedODataResult.cs +++ b/src/Microsoft.AspNetCore.OData/Results/UnauthorizedODataResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Threading.Tasks; using Microsoft.AspNetCore.Http; diff --git a/src/Microsoft.AspNetCore.OData/Results/UnprocessableEntityODataResult .cs b/src/Microsoft.AspNetCore.OData/Results/UnprocessableEntityODataResult .cs index 5c3213ec55..a8b1089f84 100644 --- a/src/Microsoft.AspNetCore.OData/Results/UnprocessableEntityODataResult .cs +++ b/src/Microsoft.AspNetCore.OData/Results/UnprocessableEntityODataResult .cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETSTANDARD2_0 using System.Threading.Tasks; diff --git a/src/Microsoft.AspNetCore.OData/Results/UpdatedODataResult.cs b/src/Microsoft.AspNetCore.OData/Results/UpdatedODataResult.cs index 6019e33a99..3efdbcc8f7 100644 --- a/src/Microsoft.AspNetCore.OData/Results/UpdatedODataResult.cs +++ b/src/Microsoft.AspNetCore.OData/Results/UpdatedODataResult.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/ActionRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/ActionRoutingConvention.cs index b422754d3c..053c50890f 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/ActionRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/ActionRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/AttributeRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/AttributeRoutingConvention.cs index e2476ff993..2bcb8df382 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/AttributeRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/AttributeRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/DynamicPropertyRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/DynamicPropertyRoutingConvention.cs index f280ad1e76..95db9d2d5c 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/DynamicPropertyRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/DynamicPropertyRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; @@ -24,4 +28,4 @@ public override string SelectAction(RouteContext routeContext, SelectControllerR new WebApiActionMap(actionDescriptors)); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/EntityRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/EntityRoutingConvention.cs index d5817d85b9..7150a96ade 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/EntityRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/EntityRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/EntitySetRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/EntitySetRoutingConvention.cs index e29941c95a..66376aa74b 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/EntitySetRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/EntitySetRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/FunctionRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/FunctionRoutingConvention.cs index bddba5882d..73163ed72e 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/FunctionRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/FunctionRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/IODataRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/IODataRoutingConvention.cs index 2040addd75..ca6e5b3d4c 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/IODataRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/IODataRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.Abstractions; @@ -23,4 +27,4 @@ public interface IODataRoutingConvention /// IEnumerable SelectAction(RouteContext routeContext); } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/MetadataRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/MetadataRoutingConvention.cs index c685e7081d..6511fe6db7 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/MetadataRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/MetadataRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -56,4 +60,4 @@ public IEnumerable SelectAction(RouteContext routeCo return null; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/NavigationRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/NavigationRoutingConvention.cs index fd894041f2..0a5f5f00bd 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/NavigationRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/NavigationRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/NavigationSourceRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/NavigationSourceRoutingConvention.cs index 7b8dfa93c6..f47f8eb3a3 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/NavigationSourceRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/NavigationSourceRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/NestedPathsRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/NestedPathsRoutingConvention.cs new file mode 100644 index 0000000000..2d1d2ff2b4 --- /dev/null +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/NestedPathsRoutingConvention.cs @@ -0,0 +1,31 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using Microsoft.AspNet.OData.Adapters; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNetCore.Mvc.Controllers; +using Microsoft.AspNetCore.Routing; + +namespace Microsoft.AspNet.OData.Routing.Conventions +{ + /// + /// An implementation of that handles GET requests with arbitrarily nested paths. + /// + public partial class NestedPathsRoutingConvention + { + /// + /// This signature uses types that are AspNetCore-specific. + public override string SelectAction(RouteContext routeContext, SelectControllerResult controllerResult, IEnumerable actionDescriptors) + { + return SelectActionImpl( + routeContext.HttpContext.ODataFeature().Path, + new WebApiControllerContext(routeContext, controllerResult), + new WebApiActionMap(actionDescriptors)); + } + } +} diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/ODataRoutingConventions.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/ODataRoutingConventions.cs index 5033ddd93b..226c12cf70 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/ODataRoutingConventions.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/ODataRoutingConventions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -77,8 +81,9 @@ public static IList CreateDefault() new RefRoutingConvention(), new ActionRoutingConvention(), new FunctionRoutingConvention(), + new NestedPathsRoutingConvention(), new UnmappedRequestRoutingConvention() }; } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/OperationImportRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/OperationImportRoutingConvention.cs index 068d044e53..fba01d1ccf 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/OperationImportRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/OperationImportRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/PropertyRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/PropertyRoutingConvention.cs index bb6952d7ea..1e0222a293 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/PropertyRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/PropertyRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/RefRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/RefRoutingConvention.cs index f8e996d297..4114d37f73 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/RefRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/RefRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; @@ -24,4 +28,4 @@ public override string SelectAction(RouteContext routeContext, SelectControllerR new WebApiActionMap(actionDescriptors)); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/SingletonRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/SingletonRoutingConvention.cs index 213fe0e031..6d597adf48 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/SingletonRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/SingletonRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Routing/Conventions/UnmappedRequestRoutingConvention.cs b/src/Microsoft.AspNetCore.OData/Routing/Conventions/UnmappedRequestRoutingConvention.cs index 5a28ac46f6..0f74712e18 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/Conventions/UnmappedRequestRoutingConvention.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/Conventions/UnmappedRequestRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Adapters; diff --git a/src/Microsoft.AspNetCore.OData/Routing/ODataActionSelector.cs b/src/Microsoft.AspNetCore.OData/Routing/ODataActionSelector.cs index 676387f780..3289dac7da 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/ODataActionSelector.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/ODataActionSelector.cs @@ -1,10 +1,15 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; using System.Diagnostics.Contracts; using System.Linq; +using System.Reflection; using Microsoft.AspNet.OData.Common; using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNet.OData.Routing.Conventions; @@ -136,7 +141,7 @@ public ActionDescriptor SelectBestCandidate(RouteContext context, IReadOnlyList< // Filter out types we know how to bind out of the parameter lists. These values // do not show up in RouteData() but will bind properly later. - var considerCandidates = candidates + IEnumerable considerCandidates = candidates .Select(c => new ActionIdAndParameters( id: c.Id, parameterCount: c.Parameters.Count, @@ -161,8 +166,8 @@ public ActionDescriptor SelectBestCandidate(RouteContext context, IReadOnlyList< // Method(key,ODataQueryOptions) vs Method(key). // Method(key,relatedKey) vs Method(key). // Method(key,relatedKey,ODataPath) vs Method(key,relatedKey). - var matchedCandidates = considerCandidates - .Where(c => TryMatch(context, c.FilteredParameters, availableKeys, + List matchedCandidates = considerCandidates + .Where(c => TryMatch(context, c.ActionDescriptor, c.FilteredParameters, availableKeys, optionalWrapper, c.TotalParameterCount, availableKeysCount)) .OrderByDescending(c => c.FilteredParameters.Count) .ThenByDescending(c => c.TotalParameterCount) @@ -173,7 +178,7 @@ public ActionDescriptor SelectBestCandidate(RouteContext context, IReadOnlyList< { // prioritize actions which explicitly declare the request method // e.g. using [AcceptVerbs("POST")], [HttpPost], etc. - var bestCandidate = matchedCandidates.FirstOrDefault(candidate => + ActionIdAndParameters bestCandidate = matchedCandidates.FirstOrDefault(candidate => ActionAcceptsMethod(candidate.ActionDescriptor as ControllerActionDescriptor, context.HttpContext.Request.Method)); if (bestCandidate != null) { @@ -203,6 +208,7 @@ public ActionDescriptor SelectBestCandidate(RouteContext context, IReadOnlyList< /// of the action with the data in the route. /// /// The current + /// The action descriptor /// Parameters of the action. This excludes the and parameters /// The names of the keys found in the uri (entity set keys, related keys, operation parameters) /// Used to check whether a parameter is optional @@ -212,12 +218,26 @@ public ActionDescriptor SelectBestCandidate(RouteContext context, IReadOnlyList< /// private bool TryMatch( RouteContext context, + ActionDescriptor actionDescriptor, IList parameters, IList availableKeys, ODataOptionalParameter optionalWrapper, int totalParameterCount, int availableKeysCount) { + + // if action has [EnableNestedPaths] attribute, then it doesn't + // need to match parameters, since this action is expected to + // match arbitrarily nested paths even if it doesn't have any parameters + if (actionDescriptor is ControllerActionDescriptor controllerActionDescriptor) + { + if (controllerActionDescriptor.MethodInfo + .GetCustomAttributes().Any()) + { + return true; + } + } + // navigationProperty is optional in some cases, therefore an action // should not be rejected simply because it does not declare a navigationProperty parameter if (availableKeys.Contains(ODataRouteConstants.NavigationProperty.ToLowerInvariant())) @@ -233,9 +253,9 @@ private bool TryMatch( } bool matchedBody = false; - var conventionsStore = context.HttpContext.ODataFeature().RoutingConventionsStore; + IDictionary conventionsStore = context.HttpContext.ODataFeature().RoutingConventionsStore; // use the parameter name to match. - foreach (var p in parameters) + foreach (ParameterDescriptor p in parameters) { string parameterName = p.Name.ToLowerInvariant(); if (availableKeys.Contains(parameterName)) @@ -288,7 +308,6 @@ private bool TryMatch( return true; } - private bool RequestHasBody(RouteContext context) { string method = context.HttpContext.Request.Method; @@ -311,7 +330,7 @@ private bool IsParameterFromQuery(ControllerActionDescriptor action, string para { Contract.Assert(action != null); - var param = action.MethodInfo.GetParameters().FirstOrDefault(p => p.Name == paramName); + ParameterInfo param = action.MethodInfo.GetParameters().FirstOrDefault(p => p.Name == paramName); if (param == null) { return false; @@ -327,8 +346,8 @@ private bool ParameterHasRegisteredModelBinder(ParameterDescriptor param) return false; } - var modelMetadata = _modelMetadataProvider.GetMetadataForType(param.ParameterType); - var binderContext = new ModelBinderFactoryContext() + ModelMetadata modelMetadata = _modelMetadataProvider.GetMetadataForType(param.ParameterType); + ModelBinderFactoryContext binderContext = new ModelBinderFactoryContext() { Metadata = modelMetadata, BindingInfo = param.BindingInfo, @@ -338,7 +357,7 @@ private bool ParameterHasRegisteredModelBinder(ParameterDescriptor param) try { - var binder = _modelBinderFactory.CreateBinder(binderContext); + IModelBinder binder = _modelBinderFactory.CreateBinder(binderContext); // ignore some built-in model binders because we already account for parameters that come from the request return (!(binder is SimpleTypeModelBinder) && !(binder is BodyModelBinder) diff --git a/src/Microsoft.AspNetCore.OData/Routing/ODataPathParameterBindingAttribute.cs b/src/Microsoft.AspNetCore.OData/Routing/ODataPathParameterBindingAttribute.cs index 1bad81fb82..68563e0a99 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/ODataPathParameterBindingAttribute.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/ODataPathParameterBindingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/src/Microsoft.AspNetCore.OData/Routing/ODataPathRouteConstraint.cs b/src/Microsoft.AspNetCore.OData/Routing/ODataPathRouteConstraint.cs index 365a590a37..ce4eaded0f 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/ODataPathRouteConstraint.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/ODataPathRouteConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/src/Microsoft.AspNetCore.OData/Routing/ODataRoute.cs b/src/Microsoft.AspNetCore.OData/Routing/ODataRoute.cs index 3ace371d70..4a1c24937d 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/ODataRoute.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/ODataRoute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; using Microsoft.AspNetCore.Routing; @@ -118,4 +122,4 @@ internal VirtualPathData GenerateLinkDirectly(string odataPath) return new VirtualPathData(this, link); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/Routing/ODataVersionConstraint.cs b/src/Microsoft.AspNetCore.OData/Routing/ODataVersionConstraint.cs index cd65aec52a..a40832a030 100644 --- a/src/Microsoft.AspNetCore.OData/Routing/ODataVersionConstraint.cs +++ b/src/Microsoft.AspNetCore.OData/Routing/ODataVersionConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/src/Microsoft.AspNetCore.OData/SingleResult.cs b/src/Microsoft.AspNetCore.OData/SingleResult.cs index f81744f400..62a8dcd71d 100644 --- a/src/Microsoft.AspNetCore.OData/SingleResult.cs +++ b/src/Microsoft.AspNetCore.OData/SingleResult.cs @@ -1,4 +1,11 @@ -// Copyright (c) .NET Foundation. All rights reserved. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +// Copyright (c) .NET Foundation. All rights reserved. // Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. using System.Linq; @@ -44,4 +51,4 @@ public static SingleResult Create(IQueryable queryable) return new SingleResult(queryable); } } -} \ No newline at end of file +} diff --git a/src/Microsoft.AspNetCore.OData/SingleResultOfT.cs b/src/Microsoft.AspNetCore.OData/SingleResultOfT.cs index 9bc2b91dbe..86e1e1c521 100644 --- a/src/Microsoft.AspNetCore.OData/SingleResultOfT.cs +++ b/src/Microsoft.AspNetCore.OData/SingleResultOfT.cs @@ -1,5 +1,9 @@ -// Copyright (c) .NET Foundation. All rights reserved. -// Licensed under the Apache License, Version 2.0. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; @@ -32,4 +36,4 @@ public SingleResult(IQueryable queryable) } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationContextCore.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationContextCore.cs index 8508de17c8..5f42c32d78 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationContextCore.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationContextCore.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.EntityFrameworkCore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationController.cs index e44dee2b5b..c8abcc428e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationDataModel.cs index 88b80c525d..43f3eddd70 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationEdmModel.cs index 3e16ee89e0..45c0068413 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationTests.cs index 1f7c43815f..39900c008a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/AggregationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/LinqToSqlDatabaseContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/LinqToSqlDatabaseContext.cs index e3793a2612..727c4bac0a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/LinqToSqlDatabaseContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/LinqToSqlDatabaseContext.cs @@ -1,4 +1,11 @@ -using System; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; using System.Collections.Generic; using System.Data.Linq; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedAggregationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedAggregationTests.cs index f7e85f9922..0560ddd304 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedAggregationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedAggregationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedCustomersController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedCustomersController.cs index b1f7089c5c..2d3314b43e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedCustomersController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Aggregation/PagedCustomersController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysController.cs index c1425c06ca..21dea0a2ac 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysDataSource.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysDataSource.cs index 8639c63fb5..31c3b59700 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysDataSource.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysDataSource.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysEdmModel.cs index 5e93eb686d..70c89d18cd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysTest.cs index a19697b036..c5ebc50d2b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AlternateKeys/AlternateKeysTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandController.cs index 35b764ab0d..72f14ab870 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandDataModel.cs index c79f98acf9..f68eef2f03 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Data.Entity; using Microsoft.AspNet.OData.Builder; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandEdmModel.cs index 8eec10dfc2..851150e7eb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.Test.E2E.AspNet.OData.Common.Execution; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandTests.cs index 4e26a2b1d3..081f7a3415 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/AutoExpand/AutoExpandTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Client/DefaultBatchGeneratedClient.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Client/DefaultBatchGeneratedClient.cs index 65fe97f269..a0ae79eb6f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Client/DefaultBatchGeneratedClient.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Client/DefaultBatchGeneratedClient.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34011 diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Client/UnbufferedBatchGeneratedClient.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Client/UnbufferedBatchGeneratedClient.cs index ae774230b3..d97b317370 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Client/UnbufferedBatchGeneratedClient.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Client/UnbufferedBatchGeneratedClient.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34011 diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/DefaultODataBatchHandlerTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/DefaultODataBatchHandlerTests.cs index 9572ce955c..46e62ac6e7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/DefaultODataBatchHandlerTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/DefaultODataBatchHandlerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/UnbufferedODataBatchHandlerTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/UnbufferedODataBatchHandlerTests.cs index be868b0c0b..f716a02dcf 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/UnbufferedODataBatchHandlerTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Batch/Tests/DataServicesClient/UnbufferedODataBatchHandlerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationContextUriTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationContextUriTest.cs index e474efa2b7..e4938830ba 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationContextUriTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationContextUriTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationController.cs index 7e7815b15f..ae3cc13b7c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationDataModel.cs index 89f5360223..570b654658 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationEdmModel.cs index a6f0af2d24..36b7e1a772 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationTest.cs index 38be5fee6a..2d6aee591a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BoundOperation/BoundOperationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Aggregation/LinqToSqlDatabaseContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Aggregation/LinqToSqlDatabaseContext.cs index e3793a2612..727c4bac0a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Aggregation/LinqToSqlDatabaseContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Aggregation/LinqToSqlDatabaseContext.cs @@ -1,4 +1,11 @@ -using System; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; using System.Collections.Generic; using System.Data.Linq; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Formatter/JsonLight/Metadata/Extensions/HttpRequestMessageExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Formatter/JsonLight/Metadata/Extensions/HttpRequestMessageExtensions.cs index 2b741043e7..a9120a9e1c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Formatter/JsonLight/Metadata/Extensions/HttpRequestMessageExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Formatter/JsonLight/Metadata/Extensions/HttpRequestMessageExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Formatter/ODataEntityReferenceLinkE2ETests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Formatter/ODataEntityReferenceLinkE2ETests.cs new file mode 100644 index 0000000000..40ff2933b3 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Formatter/ODataEntityReferenceLinkE2ETests.cs @@ -0,0 +1,276 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Data.Entity; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Routing; +using Microsoft.OData.Edm; +using Microsoft.Test.E2E.AspNet.OData.Common.Controllers; +using Microsoft.Test.E2E.AspNet.OData.Common.Execution; +using Newtonsoft.Json.Linq; +using Xunit; + +namespace Microsoft.Test.E2E.AspNet.OData.Formatter +{ + public class ODataEntityReferenceLinkE2ETests : WebHostTestBase + { + public ODataEntityReferenceLinkE2ETests(WebHostTestFixture fixture) + : base(fixture) + { + } + protected override void UpdateConfiguration(WebRouteConfiguration configuration) + { + var controllers = new[] { typeof(BooksController)}; + configuration.AddControllers(controllers); + configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); + configuration.MapODataServiceRoute("odata", "odata", BuildEdmModel(configuration)); + } + private static IEdmModel BuildEdmModel(WebRouteConfiguration configuration) + { + var builder = configuration.CreateConventionModelBuilder(); + builder.EntitySet("Books"); + builder.EntitySet("Authors"); + builder.Action("ResetDataSource"); + builder.Action("RelateToExistingEntityAndUpdate").ReturnsFromEntitySet("Books").EntityParameter("book"); + + return builder.GetEdmModel(); + } + + [Fact] + public async Task CanCreate_ANewEntityAndRelateToAnExistingEntity_UsingODataBind() + { + await ResetDataSource(); + // Arrange + const string Payload = "{" + + "\"Id\":\"1\"," + + "\"Name\":\"BookA\"," + + "\"Author@odata.bind\":\"Authors(1)\"}"; + + string Uri = BaseAddress + "/odata/Books"; + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, Uri); + + request.Content = new StringContent(Payload); + request.Content.Headers.ContentType = MediaTypeWithQualityHeaderValue.Parse("application/json"); + + // Act + HttpResponseMessage response = await Client.SendAsync(request); + + // Assert + Assert.True(response.IsSuccessStatusCode); + Assert.Equal(HttpStatusCode.Created, response.StatusCode); + Assert.NotNull(response.Content); + + //Get the above saved entity from the database + //and expand the navigation property to see if + //it was correctly created with the existing entity + //attached to it. + string query = string.Format("{0}/odata/Books?$expand=Author", BaseAddress); + HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, query); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json")); + + // Act + HttpResponseMessage res = await Client.SendAsync(requestMessage); + + // Assert + Assert.True(res.IsSuccessStatusCode); + var responseObject = JObject.Parse(await res.Content.ReadAsStringAsync()); + var result = responseObject["value"] as JArray; + var expandProp = result[0]["Author"] as JObject; + Assert.Equal(1, expandProp["Id"]); + + } + + [Fact] + public async Task CanUpdate_TheRelatedEntitiesProperties() + { + await ResetDataSource(); + // Arrange + const string Payload = "{" + + "\"book\":{" + + "\"Id\":\"1\"," + + "\"Name\":\"BookA\"," + + "\"Author\":{" + + "\"@odata.id\":\"Authors(1)\"," + + "\"Name\":\"UpdatedAuthor\"}}}"; + + string Uri = BaseAddress + "/odata/RelateToExistingEntityAndUpdate"; + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Post, Uri); + + request.Content = new StringContent(Payload); + request.Content.Headers.ContentType = MediaTypeWithQualityHeaderValue.Parse("application/json"); + + // Act + HttpResponseMessage response = await Client.SendAsync(request); + + // Assert + Assert.True(response.IsSuccessStatusCode); + Assert.Equal(HttpStatusCode.Created, response.StatusCode); + Assert.NotNull(response.Content); + + //Get the above saved entity from the database + //and expand its navigation property to see if it was created with + //the existing entity correctly. + //Also note that we were able to update the name property + //of the existing entity + string query = string.Format("{0}/odata/Books?$expand=Author", BaseAddress); + HttpRequestMessage requestMessage = new HttpRequestMessage(HttpMethod.Get, query); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json")); + + // Act + HttpResponseMessage res = await Client.SendAsync(requestMessage); + + // Assert + Assert.True(res.IsSuccessStatusCode); + var responseObject = JObject.Parse(await res.Content.ReadAsStringAsync()); + var result = responseObject["value"] as JArray; + var expandProp = result[0]["Author"] as JObject; + Assert.Equal(1, expandProp["Id"]); + Assert.Equal("UpdatedAuthor", expandProp["Name"]); + } + + private async Task ResetDataSource() + { + string requestUri = BaseAddress + "/odata/ResetDataSource"; + HttpClient client = new HttpClient(); + HttpResponseMessage response = await client.GetAsync(requestUri); + response.EnsureSuccessStatusCode(); + } + } + + public class BooksController : TestODataController +#if NETCORE + , IDisposable +#endif + { + private ODataEntityReferenceLinkContext db = new ODataEntityReferenceLinkContext(); + + [EnableQuery] + public ITestActionResult Get() + { + return Ok(db.Books); + } + public ITestActionResult Post([FromBody] Book book) + { + if (!ModelState.IsValid) + { + return BadRequest(); + } + + db.Authors.Attach(book.Author); + db.Books.Add(book); + db.SaveChanges(); + + return Created(book); + } + + [HttpPost] + [ODataRoute("RelateToExistingEntityAndUpdate")] + public ITestActionResult RelateToExistingEntityAndUpdate(ODataActionParameters odataActionParameters) + { + if (!ModelState.IsValid) + { + return BadRequest(); + } + + Book book = (Book)odataActionParameters["book"]; + string authorName = book.Author.Name; + Author author = new Author() + { + Id = book.Author.Id + }; + db.Authors.Attach(author); + book.Author = author; + book.Author.Name = authorName; + db.Books.Add(book); + + db.SaveChanges(); + return Created(book); + } + + [HttpGet] + [ODataRoute("ResetDataSource")] + public ITestActionResult ResetDataSource() + { + db.Database.Delete(); // Start from scratch so that tests aren't broken by schema changes. + CreateDatabase(); + return Ok(); + } + + private static void CreateDatabase() + { + using (ODataEntityReferenceLinkContext db = new ODataEntityReferenceLinkContext()) + { + if (!db.Authors.Any()) + { + IList authors = new List() + { + new Author() + { + Id = 1, + Name = "AuthorA" + }, + new Author() + { + Id = 2, + Name = "AuthorB" + }, + new Author() + { + Id = 3, + Name = "AuthorC" + } + }; + + foreach (var author in authors) + { + db.Authors.Add(author); + } + db.SaveChanges(); + } + } + } + +#if NETCORE + public void Dispose() + { + //_db.Dispose(); + } +#endif + + } + + public class Book + { + [Key] + public int Id { get; set; } + public string Name { get; set; } + public Author Author { get; set; } + public IList AuthorList { get; set; } + } + + public class Author + { + [Key] + public int Id { get; set; } + public string Name { get; set; } + } + + public class ODataEntityReferenceLinkContext : DbContext + { + public static string ConnectionString = @"Data Source=(LocalDb)\MSSQLLocalDB;Integrated Security=True;Initial Catalog=ODataEntityReferenceLinkContext"; + public ODataEntityReferenceLinkContext() + : base(ConnectionString) + { + } + public DbSet Books { get; set; } + public DbSet Authors { get; set; } + } +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationController.cs index 92f1a994c5..6f14795a5b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationDataModel.cs index 9eaaa27c67..e001bd6d28 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationEdmModel.cs index eebb7327df..f1c1229525 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationTest.cs index 2ee6692369..d50a510425 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/InstanceAnnotations/AnnotationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -239,4 +243,4 @@ private void VerifyInstanceAnnotations(string name, string json) } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Microsoft.Test.E2E.AspNet.OData.csproj b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Microsoft.Test.E2E.AspNet.OData.csproj index 6b439e284b..d8f39cbbc7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Microsoft.Test.E2E.AspNet.OData.csproj +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Microsoft.Test.E2E.AspNet.OData.csproj @@ -35,14 +35,14 @@ ..\..\..\..\sln\packages\Microsoft.Data.OData.5.8.4\lib\net40\Microsoft.Data.OData.dll True - - ..\..\..\..\sln\packages\Microsoft.OData.Client.7.9.0\lib\net45\Microsoft.OData.Client.dll + + ..\..\..\..\sln\packages\Microsoft.OData.Client.7.9.1\lib\net45\Microsoft.OData.Client.dll - - ..\..\..\..\sln\packages\Microsoft.OData.Core.7.9.0\lib\net45\Microsoft.OData.Core.dll + + ..\..\..\..\sln\packages\Microsoft.OData.Core.7.9.1\lib\net45\Microsoft.OData.Core.dll - - ..\..\..\..\sln\packages\Microsoft.OData.Edm.7.9.0\lib\net45\Microsoft.OData.Edm.dll + + ..\..\..\..\sln\packages\Microsoft.OData.Edm.7.9.1\lib\net45\Microsoft.OData.Edm.dll ..\..\..\..\sln\packages\Microsoft.Owin.2.0.2\lib\net45\Microsoft.Owin.dll @@ -56,8 +56,8 @@ ..\..\..\..\sln\packages\Microsoft.Owin.Hosting.2.0.2\lib\net45\Microsoft.Owin.Hosting.dll True - - ..\..\..\..\sln\packages\Microsoft.Spatial.7.9.0\lib\net45\Microsoft.Spatial.dll + + ..\..\..\..\sln\packages\Microsoft.Spatial.7.9.1\lib\net45\Microsoft.Spatial.dll True @@ -151,6 +151,21 @@ Aggregation\AggregationTests.cs + + BulkOperation\BulkInsertDataModel.cs + + + BulkOperation\BulkInsertEdmModel.cs + + + BulkOperation\BulkInsertTest.cs + + + BulkOperation\BulkInsertController.cs + + + BulkOperation\BulkOperationPatchHandlers.cs + EntitySetAggregation\EntitySetAggregationController.cs diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Properties/AssemblyInfo.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Properties/AssemblyInfo.cs index 21d248af39..cd14d4cfe6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Properties/AssemblyInfo.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/Properties/AssemblyInfo.cs @@ -1,4 +1,11 @@ -using System.Reflection; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs index 03318071e1..eb50eb4950 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/packages.config b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/packages.config index 4d57b0c00e..d063b15ca5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/packages.config +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNet/packages.config @@ -10,13 +10,13 @@ - - - + + + - + @@ -46,7 +46,7 @@ - + diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Aggregation/LinqToSqlDatabaseContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Aggregation/LinqToSqlDatabaseContext.cs index e69da2f725..727c4bac0a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Aggregation/LinqToSqlDatabaseContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Aggregation/LinqToSqlDatabaseContext.cs @@ -1,4 +1,11 @@ -using System; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; using System.Collections.Generic; using System.Data.Linq; using System.Linq; @@ -17,4 +24,4 @@ public LinqToSqlDatabaseContext() : public Table Customers { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/DependencyInjection/CustomizeSkipTokenImplementationTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/DependencyInjection/CustomizeSkipTokenImplementationTest.cs index 406a4cbc60..2feb47a7f8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/DependencyInjection/CustomizeSkipTokenImplementationTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/DependencyInjection/CustomizeSkipTokenImplementationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Microsoft.Test.E2E.AspNetCore.OData.csproj b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Microsoft.Test.E2E.AspNetCore.OData.csproj index 90cd827f5f..9ca7c3050d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Microsoft.Test.E2E.AspNetCore.OData.csproj +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Microsoft.Test.E2E.AspNetCore.OData.csproj @@ -1399,6 +1399,18 @@ OpenType\TypedTest.cs + + BulkOperation\BulkInsertDataModel.cs + + + BulkOperation\BulkInsertEdmModel.cs + + + BulkOperation\BulkInsertController.cs + + + BulkOperation\BulkOperationPatchHandlers.cs + ParameterAlias\ParameterAliasDataSource.cs @@ -1843,17 +1855,17 @@ ..\..\..\..\sln\packages\Microsoft.Net.Http.Headers.2.0.3\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll - - ..\..\..\..\sln\packages\Microsoft.OData.Client.7.9.0\lib\net45\Microsoft.OData.Client.dll + + ..\..\..\..\sln\packages\Microsoft.OData.Client.7.9.1\lib\net45\Microsoft.OData.Client.dll - - ..\..\..\..\sln\packages\Microsoft.OData.Core.7.9.0\lib\net45\Microsoft.OData.Core.dll + + ..\..\..\..\sln\packages\Microsoft.OData.Core.7.9.1\lib\net45\Microsoft.OData.Core.dll - - ..\..\..\..\sln\packages\Microsoft.OData.Edm.7.9.0\lib\net45\Microsoft.OData.Edm.dll + + ..\..\..\..\sln\packages\Microsoft.OData.Edm.7.9.1\lib\net45\Microsoft.OData.Edm.dll - - ..\..\..\..\sln\packages\Microsoft.Spatial.7.9.0\lib\net45\Microsoft.Spatial.dll + + ..\..\..\..\sln\packages\Microsoft.Spatial.7.9.1\lib\net45\Microsoft.Spatial.dll ..\..\..\..\sln\packages\Newtonsoft.Json.10.0.1\lib\net45\Newtonsoft.Json.dll diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Properties/AssemblyInfo.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Properties/AssemblyInfo.cs index bd6f826702..2e2249cfe5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Properties/AssemblyInfo.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/Properties/AssemblyInfo.cs @@ -1,4 +1,11 @@ -using System.Reflection; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/packages.config b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/packages.config index 75c6cae84f..6f351abc25 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/packages.config +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore/packages.config @@ -61,10 +61,10 @@ - - - - + + + + diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultController.cs index 9548093287..81bd44c321 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultEdmModel.cs index 66950fbe42..85b8987bb3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.Test.E2E.AspNet.OData.Common.Execution; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultODataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultODataModel.cs index dab22933db..ccb5214614 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultODataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultODataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultTests.cs index be389e1800..54a642f778 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ActionResult/ActionResultTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Aggregation/LinqToSqlDatabaseContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Aggregation/LinqToSqlDatabaseContext.cs index b7ca09d329..911a0b357b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Aggregation/LinqToSqlDatabaseContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Aggregation/LinqToSqlDatabaseContext.cs @@ -1,4 +1,11 @@ -#if !NETCORE +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +#if !NETCORE using System; using System.Collections.Generic; using System.Data.Linq; @@ -19,4 +26,4 @@ public LinqToSqlDatabaseContext() : public Table Customers { get; set; } } } -#endif \ No newline at end of file +#endif diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/BulkOperation/EFTests/BulkInsertTestEF.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/BulkOperation/EFTests/BulkInsertTestEF.cs new file mode 100644 index 0000000000..5919eb09f3 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/BulkOperation/EFTests/BulkInsertTestEF.cs @@ -0,0 +1,252 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Routing; +using Microsoft.AspNet.OData.Routing.Conventions; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Test.E2E.AspNet.OData.BulkOperation; +using Microsoft.Test.E2E.AspNet.OData.Common.Execution; +using Microsoft.Test.E2E.AspNet.OData.Common.Extensions; +using Newtonsoft.Json.Linq; +using Xunit; + +namespace Microsoft.Test.E2E.AspNet.OData.BulkInsert +{ + public class BulkInsertTestEF : WebHostTestBase + { + public BulkInsertTestEF(WebHostTestFixture fixture) + :base(fixture) + { + } + + protected override void UpdateConfiguration(WebRouteConfiguration configuration) + { + var controllers = new[] { typeof(EmployeesControllerEF), typeof(MetadataController) }; + configuration.AddControllers(controllers); + + configuration.Routes.Clear(); + configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); + configuration.MapODataServiceRoute("convention", "convention", BulkInsertEdmModel.GetConventionModel(configuration)); + configuration.MapODataServiceRoute("explicit", "explicit", BulkInsertEdmModel.GetExplicitModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); + configuration.EnsureInitialized(); + + } + + + #region Update + + [Fact] + public async Task PatchEmployee_WithUpdates() + { + //Arrange + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'Sql' , + 'Friends@odata.delta':[{'Id':1,'Name':'Test2'},{'Id':2,'Name':'Test3'}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = await response.Content.ReadAsObject(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Contains("Sql", json.ToString()); + } + + } + + [Fact] + public async Task PatchEmployee_WithUpdates_WithEmployees() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'SqlFU' , + 'Friends':[{'Id':345,'Name':'Test2'},{'Id':400,'Name':'Test3'},{'Id':900,'Name':'Test93'}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = await response.Content.ReadAsObject(); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Contains("SqlFU", json.ToString()); + } + + } + + [Fact] + public async Task PatchEmployee_WithUpdates_Employees() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees"; + + var content = @"{'@odata.context':'http://localhost:11001/convention/$metadata#Employees/$delta', + 'value':[{ '@odata.type': '#Microsoft.Test.E2E.AspNet.OData.BulkInsert.Employee', 'ID':1,'Name':'Employee1', + 'Friends@odata.delta':[{'Id':1,'Name':'Friend1', + 'Orders@odata.delta' :[{'Id':1,'Price': 10}, {'Id':2,'Price': 20} ] },{'Id':2,'Name':'Friend2'}] + }, + { '@odata.type': '#Microsoft.Test.E2E.AspNet.OData.BulkInsert.Employee', 'ID':2,'Name':'Employee2', + 'Friends@odata.delta':[{'Id':3,'Name':'Friend3', + 'Orders@odata.delta' :[{'Id':3,'Price': 30}, {'Id':4,'Price': 40} ]},{'Id':4,'Name':'Friend4'}] + }] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + // Act & Assert + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var json = response.Content.ReadAsStringAsync().Result; + Assert.Contains("Employee1", json); + Assert.Contains("Employee2", json); + } + + } + + + [Fact] + public async Task PatchEmployee_WithDelete() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'Sql', + 'Friends@odata.delta':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var json = response.Content.ReadAsStringAsync().Result; + Assert.Contains("Sql", json); + } + + + } + + + [Fact] + public async Task PatchEmployee_WithAddUpdateAndDelete() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'SqlUD', + 'Friends@odata.delta':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{'Id':2,'Name':'Test3'},{'Id':3,'Name':'Test4'}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var json = response.Content.ReadAsStringAsync().Result; + Assert.Contains("SqlUD", json); + } + + } + + + [Fact] + public async Task PatchEmployee_WithMultipleUpdatesinOrder1() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'SqlMU' , + 'Friends@odata.delta':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{'Id':1,'Name':'Test_1'},{'Id':2,'Name':'Test3'},{'Id':3,'Name':'Test4'}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var json = response.Content.ReadAsStringAsync().Result; + Assert.Contains("SqlMU", json); + } + + } + + [Fact] + public async Task PatchEmployee_WithMultipleUpdatesinOrder2() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'SqlMU1' , + 'Friends@odata.delta':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{'Id':1,'Name':'Test_1'},{'Id':2,'Name':'Test3'},{'Id':3,'Name':'Test4'},{ '@odata.removed' : {'reason':'changed'}, 'Id':1}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var json = response.Content.ReadAsStringAsync().Result; + Assert.Contains("SqlMU1", json); + } + + } + + + #endregion + + } +} \ No newline at end of file diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/BulkOperation/EFTests/BulkOperationControllerEF.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/BulkOperation/EFTests/BulkOperationControllerEF.cs new file mode 100644 index 0000000000..918c2c3bc6 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/BulkOperation/EFTests/BulkOperationControllerEF.cs @@ -0,0 +1,196 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Diagnostics.Contracts; +using System.Linq; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Routing; +using Microsoft.EntityFrameworkCore; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.Test.E2E.AspNet.OData.BulkOperation; +using Microsoft.Test.E2E.AspNet.OData.Common.Controllers; +using Xunit; + +namespace Microsoft.Test.E2E.AspNet.OData.BulkInsert +{ + public class EmployeesControllerEF : TestODataController + { + public EmployeesControllerEF() + { + + } + + public static List employees; + public static List friends; + + public DbSet GenerateData(EmployeeDBContext context) + { + if (context.Employees.Any()) + { + return context.Employees; + } + + var friends = GenerateDataOrders(context); + + employees = new List(); + employees.Add(new Employee { ID = 1, Name = "Employee1", Friends = friends.Where(x => x.Id == 1 || x.Id == 2).ToList() }); + employees.Add(new Employee { ID = 2, Name = "Employee2", Friends = friends.Where(x => x.Id == 3 || x.Id == 4).ToList() }); + employees.Add(new Employee { ID = 3, Name = "Employee3", Friends = friends.Where(x => x.Id == 5 || x.Id == 6).ToList() }); + + context.Employees.AddRange(employees); + + context.SaveChanges(); + + return context.Employees; + } + + public DbSet GenerateDataOrders(EmployeeDBContext context) + { + if (context.Friends.Any()) + { + return context.Friends; + } + + friends = new List(); + friends.Add(new Friend { Id = 1, Age = 10 , Orders = new List() { new Order { Id = 1, Price = 5 }, new Order { Id = 2, Price = 5 } } }); + friends.Add(new Friend { Id = 2, Age = 20, Orders = new List() { new Order { Id = 10, Price = 5 }, new Order { Id = 20, Price = 5 } } }); + friends.Add(new Friend { Id = 3, Age = 30, Orders = new List() { new Order { Id = 3, Price = 5 }, new Order { Id = 4, Price = 5 } } }); + friends.Add(new Friend { Id = 4, Age = 40, Orders = new List() { new Order { Id = 30, Price = 5 }, new Order { Id = 40, Price = 5 } } }); + friends.Add(new Friend { Id = 5, Age = 50, Orders = new List() { new Order { Id = 5, Price = 5 }, new Order { Id = 6, Price = 5 } } }); + friends.Add(new Friend { Id = 6, Age = 60, Orders = new List() { new Order { Id = 50, Price = 5 }, new Order { Id = 60, Price = 5 } } }); + + context.Friends.AddRange(friends); + + context.SaveChanges(); + + return context.Friends; + } + + + [ODataRoute("Employees")] + [HttpPatch] + public ITestActionResult PatchEmployees([FromBody] DeltaSet coll) + { + using (var dbContext = CreateDbContext()) + { + GenerateData(dbContext); + + Assert.NotNull(coll); + + var returncoll = coll.Patch(new APIHandlerFactoryEF(dbContext)); + + + return Ok(returncoll); + } + } + + private EmployeeDBContext CreateDbContext() + { + var buiilder = new DbContextOptionsBuilder().UseInMemoryDatabase(Guid.NewGuid().ToString()); + var dbContext = new EmployeeDBContext(buiilder.Options); + return dbContext; + } + + [ODataRoute("Employees({key})")] + public ITestActionResult Patch(int key, [FromBody] Delta delta) + { + using (var dbContext = CreateDbContext()) + { + GenerateData(dbContext); + + delta.TrySetPropertyValue("ID", key); // It is the key property, and should not be updated. + object obj; + delta.TryGetPropertyValue("Friends", out obj); + + var employee = dbContext.Employees.First(x => x.ID == key); + + try + { + delta.Patch(employee, new APIHandlerFactoryEF(dbContext)); + + } + catch (ArgumentException ae) + { + return BadRequest(ae.Message); + } + + employee = dbContext.Employees.First(x => x.ID == key); + + ValidateFriends(key, employee); + + return Ok(employee); + } + } + + private static void ValidateFriends(int key, Employee employee) + { + if (key == 1 && employee.Name == "SqlUD") + { + Contract.Assert(employee.Friends.Count == 2); + Contract.Assert(employee.Friends[0].Id == 2); + Contract.Assert(employee.Friends[1].Id == 3); + } + else if (key == 1 && employee.Name == "SqlFU") + { + Contract.Assert(employee.Friends.Count == 3); + Contract.Assert(employee.Friends[0].Id == 345); + Contract.Assert(employee.Friends[1].Id == 400); + Contract.Assert(employee.Friends[2].Id == 900); + } + else if (key == 1 && employee.Name == "SqlMU") + { + Contract.Assert(employee.Friends.Count == 3); + Contract.Assert(employee.Friends[0].Id == 2); + Contract.Assert(employee.Friends[1].Id == 1); + Contract.Assert(employee.Friends[1].Name == "Test_1"); + Contract.Assert(employee.Friends[2].Id == 3); + } + else if (key == 1 && employee.Name == "SqlMU1") + { + Contract.Assert(employee.Friends.Count == 2); + Contract.Assert(employee.Friends[0].Id == 2); + Contract.Assert(employee.Friends[1].Id == 3); + } + } + + [ODataRoute("Employees({key})/Friends")] + [HttpPatch] + public ITestActionResult PatchFriends(int key, [FromBody] DeltaSet friendColl) + { + using (var dbContext = CreateDbContext()) + { + GenerateData(dbContext); + + Employee originalEmployee = dbContext.Employees.SingleOrDefault(c => c.ID == key); + Assert.NotNull(originalEmployee); + + var changedObjColl = friendColl.Patch(originalEmployee.Friends); + + return Ok(changedObjColl); + } + } + + public ITestActionResult Get(int key) + { + using (var dbContext = CreateDbContext()) + { + var emp = dbContext.Employees.SingleOrDefault(e => e.ID == key); + return Ok(emp); + } + } + + [ODataRoute("Employees({key})/Friends")] + public ITestActionResult GetFriends(int key) + { + using (var dbContext = CreateDbContext()) + { + var emp = dbContext.Employees.SingleOrDefault(e => e.ID == key); + return Ok(emp.Friends); + } + } + + + } +} \ No newline at end of file diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/BulkOperation/EFTests/BulkOperationPatchHandlersEF.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/BulkOperation/EFTests/BulkOperationPatchHandlersEF.cs new file mode 100644 index 0000000000..c987e3bf9d --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/BulkOperation/EFTests/BulkOperationPatchHandlersEF.cs @@ -0,0 +1,440 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.AspNet.OData; +using Microsoft.EntityFrameworkCore; +using Microsoft.Test.E2E.AspNet.OData.BulkInsert; + +namespace Microsoft.Test.E2E.AspNet.OData.BulkOperation +{ + public class EmployeeDBContext : DbContext + { + public EmployeeDBContext() + { + + } + + public EmployeeDBContext(DbContextOptions options) : base(options) + { + + } + + public DbSet Employees { get; set; } + public DbSet Friends { get; set; } + + protected override void OnModelCreating(Microsoft.EntityFrameworkCore.ModelBuilder modelBuilder) + { + modelBuilder.Entity().HasKey(c => c.ID); + modelBuilder.Entity().Ignore(c => c.SkillSet); + modelBuilder.Entity().Ignore(c => c.NewFriends); + modelBuilder.Entity().Ignore(c => c.UnTypedFriends); + modelBuilder.Entity().Ignore(c => c.InstanceAnnotations); + + modelBuilder.Entity().Ignore(c => c.InstanceAnnotations); + modelBuilder.Entity().Ignore(c => c.InstanceAnnotations); + + modelBuilder.Entity().HasKey(c => c.Id); + + modelBuilder.Entity().Ignore(c => c.Container); + modelBuilder.Entity().Ignore(c => c.Container); + } + + + } + + public class APIHandlerFactoryEF: ODataAPIHandlerFactory + { + EmployeeDBContext dbContext; + + public APIHandlerFactoryEF() + { + + } + + public APIHandlerFactoryEF(EmployeeDBContext dbContext) + { + this.dbContext = dbContext; + } + + public override IODataAPIHandler GetHandler(NavigationPath navigationPath) + { + if (navigationPath != null) + { + var pathItems = navigationPath.GetNavigationPathItems(); + + if (pathItems == null) + { + switch (navigationPath.NavigationPathName) + { + case "Employees": + case "Employee": + return new EmployeeEFPatchHandler(dbContext); + + case "Company": + return new CompanyAPIHandler(); + default: + return null; + } + } + } + + return null; + + } + + public class EmployeeEFPatchHandler : ODataAPIHandler + { + EmployeeDBContext dbContext = null; + + public EmployeeEFPatchHandler(EmployeeDBContext dbContext) + { + this.dbContext = dbContext; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out Employee createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new Employee(); + dbContext.Employees.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var customer = dbContext.Employees.First(x => x.ID == Int32.Parse(id)); + + dbContext.Employees.Remove(customer); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out Employee originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["ID"].ToString(); + originalObject = dbContext.Employees.First(x => x.ID == Int32.Parse(id)); + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(Employee parent, string navigationPropertyName) + { + switch (navigationPropertyName) + { + case "Friends": + return new FriendEFPatchHandler(parent); + case "NewFriends": + return new NewFriendEFPatchHandler(parent); + default: + return null; + } + + } + + } + + public class FriendEFPatchHandler : ODataAPIHandler + { + Employee employee; + public FriendEFPatchHandler(Employee employee) + { + this.employee = employee; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out Friend createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new Friend(); + employee.Friends.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var friend = employee.Friends.First(x => x.Id == Int32.Parse(id)); + + employee.Friends.Remove(friend); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out Friend originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + if (employee.Friends == null) + { + status = ODataAPIResponseStatus.NotFound; + } + else + { + originalObject = employee.Friends.FirstOrDefault(x => x.Id == Int32.Parse(id)); + } + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(Friend parent, string navigationPropertyName) + { + return new OrderEFPatchHandler(parent); + } + + } + + + public class NewFriendEFPatchHandler : ODataAPIHandler + { + Employee employee; + public NewFriendEFPatchHandler(Employee employee) + { + this.employee = employee; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out NewFriend createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new NewFriend(); + employee.NewFriends.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var friend = employee.NewFriends.First(x => x.Id == Int32.Parse(id)); + + employee.NewFriends.Remove(friend); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out NewFriend originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + originalObject = employee.NewFriends.First(x => x.Id == Int32.Parse(id)); + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(NewFriend parent, string navigationPropertyName) + { + return null; + } + + } + + + + public class OrderEFPatchHandler : ODataAPIHandler + { + Friend friend; + public OrderEFPatchHandler(Friend friend) + { + this.friend = friend; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out Order createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new Order(); + friend.Orders.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var order = friend.Orders.First(x => x.Id == Int32.Parse(id)); + + friend.Orders.Remove(order); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out Order originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + originalObject = friend.Orders.First(x => x.Id == Int32.Parse(id)); + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(Order parent, string navigationPropertyName) + { + throw new NotImplementedException(); + } + } + + } +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryController.cs index 0bff8af3ea..10b16bf6ee 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryEdmModel.cs index 80785726eb..be5832fe2c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.Test.E2E.AspNet.OData.Common.Execution; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryODataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryODataModel.cs index 44e0fc328f..aae3b9095f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryODataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryODataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryTests.cs index 312ab0f8cf..b5a32ad6a3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/ConcurrentQuery/ConcurrentQueryTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/DependencyInjection/CustomizeSkipTokenImplementationTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/DependencyInjection/CustomizeSkipTokenImplementationTest.cs index 406a4cbc60..2feb47a7f8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/DependencyInjection/CustomizeSkipTokenImplementationTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/DependencyInjection/CustomizeSkipTokenImplementationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointController.cs index 42a7e85806..f12fa6f3f6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointDbContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointDbContext.cs index 82a2e36f7c..e221083e48 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointDbContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointDbContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.EntityFrameworkCore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointEfCoreTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointEfCoreTests.cs index 56056873aa..d3a63e7210 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointEfCoreTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointEfCoreTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -275,4 +279,3 @@ public async Task CanReadDataInBatchUsingEndpointRouting() } } } - diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointRouteConfiguration.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointRouteConfiguration.cs index 121b198990..ec96019cd3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointRouteConfiguration.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointRouteConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestBase.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestBase.cs index 8fdb0b903b..b854575b16 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestBase.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using Xunit; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestFixture.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestFixture.cs index 6eef9e87cb..c9ffe9191d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestFixture.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestFixture.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestModel.cs index 591b51c115..503deff434 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Endpoint/EndpointTestModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations.Schema; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Microsoft.Test.E2E.AspNetCore3x.OData.csproj b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Microsoft.Test.E2E.AspNetCore3x.OData.csproj index 8baade2685..397cc219ef 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Microsoft.Test.E2E.AspNetCore3x.OData.csproj +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Microsoft.Test.E2E.AspNetCore3x.OData.csproj @@ -27,7 +27,8 @@ - + + @@ -1662,6 +1663,18 @@ Validation\DeltaOfTValidationTests.cs + + BulkOperation\BulkInsertDataModel.cs + + + BulkOperation\BulkInsertEdmModel.cs + + + BulkOperation\BulkInsertController.cs + + + BulkOperation\BulkOperationPatchHandlers.cs + @@ -1675,4 +1688,5 @@ + diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/NestedPaths/NestedPathEFTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/NestedPaths/NestedPathEFTests.cs new file mode 100644 index 0000000000..14cb6f6661 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/NestedPaths/NestedPathEFTests.cs @@ -0,0 +1,380 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Data.Entity; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Routing; +using Microsoft.OData.Edm; +using Microsoft.Test.E2E.AspNet.OData.Common; +using Microsoft.Test.E2E.AspNet.OData.Common.Controllers; +using Microsoft.Test.E2E.AspNet.OData.Common.Execution; +using Newtonsoft.Json.Linq; +using Xunit; + +namespace Microsoft.Test.E2E.AspNet.OData.NestedPaths +{ + public class NestedPathEFTests : WebHostTestBase + { + public NestedPathEFTests(WebHostTestFixture fixture) + :base(fixture) + { + } + + protected override void UpdateConfiguration(WebRouteConfiguration configuration) + { + configuration.AddControllers( + typeof(EFCustomersController), + typeof(EFOrdersController), + typeof(EFProductsController)); + configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; + configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); + configuration.MapODataServiceRoute("nestedpaths", "nestedpaths", GetEdmModel(configuration)); + } + + private static IEdmModel GetEdmModel(WebRouteConfiguration configuration) + { + var builder = configuration.CreateConventionModelBuilder(); + + builder.EntitySet("EFCustomers"); + builder.EntitySet("EFProducts"); + builder.EntitySet("EFOrders"); + builder.Action("ResetDataSource-Customer"); + builder.Action("ResetDataSource-Order"); + builder.Action("ResetDataSource-Product"); + + return builder.GetEdmModel(); + } + + [Fact] + public async Task QueriesDataCorrectlyBasedOnNestedPath() + { + // Arrange + await RestoreData("-Customer"); + string queryUrl = GetFullUrl("EFCustomers(2)/Orders(6)/Products"); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=none")); + HttpClient client = new HttpClient(); + HttpResponseMessage response; + + // Act + response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.NotNull(response.Content); + + var responseObject = JObject.Parse(await response.Content.ReadAsStringAsync()); + var result = responseObject["value"] as JArray; + JsonAssert.ArrayLength(2, "value", responseObject); + + AssertJsonProduct(result[0] as JObject, 6, "Product6"); + AssertJsonProduct(result[1] as JObject, 7, "Product7"); + } + + [Fact] + public async Task QueryOptionsAreAppliedToResultIfEnableQueryProvided() + { + // Arrange + await RestoreData("-Order"); + string queryUrl = GetFullUrl("EFOrders(1)?$expand=Products"); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=none")); + HttpClient client = new HttpClient(); + HttpResponseMessage response; + + // Act + response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.NotNull(response.Content); + + var responseObject = JObject.Parse(await response.Content.ReadAsStringAsync()); + var products = responseObject["Products"] as JArray; + JsonAssert.ArrayLength(2, "Products", responseObject); + + AssertJsonProduct(products[0] as JObject, 1, "Product1"); + AssertJsonProduct(products[1] as JObject, 2, "Product2"); + } + + [Fact] + public async Task SupportsComplexProperties() + { + // Arrange + await RestoreData("-Customer"); + string queryUrl = GetFullUrl("EFCustomers(1)/HomeAddress"); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=none")); + HttpClient client = new HttpClient(); + HttpResponseMessage response; + + // Act + response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.NotNull(response.Content); + + var responseObject = JObject.Parse(await response.Content.ReadAsStringAsync()); + AssertJsonAddress(responseObject, "City1", "Street1"); + } + + [Fact] + public async Task SupportsNavigationProperties() + { + // Arrange + await RestoreData("-Customer"); + string queryUrl = GetFullUrl("EFCustomers(1)/FavoriteProduct"); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=none")); + HttpClient client = new HttpClient(); + HttpResponseMessage response; + + // Act + response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.NotNull(response.Content); + + var responseObject = JObject.Parse(await response.Content.ReadAsStringAsync()); + AssertJsonProduct(responseObject, 1, "Product1"); + } + + [Theory] + [InlineData("EFCustomers(4)/FavoriteProduct")] + [InlineData("EFCustomers(4)/Favoriteproduct/Name")] + [InlineData("EFCustomers(4)/HomeAddress/City")] + public async Task Returns404IfAccessingNullProperties(string path) + { + // Arrange + await RestoreData("-Customer"); + string queryUrl = GetFullUrl(path); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=none")); + HttpClient client = new HttpClient(); + HttpResponseMessage response; + + // Act + response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + private string GetFullUrl(string relativeUrl) + { + return $"{BaseAddress}/nestedpaths/{relativeUrl}"; + } + + private void AssertJsonProduct(JObject product, int id, string name) + { + Assert.NotNull(product); + Assert.Equal(id, product["Id"].ToObject()); + Assert.Equal(name, product["Name"].ToObject()); + } + + private void AssertJsonAddress(JObject address, string city, string street) + { + Assert.NotNull(address); + Assert.Equal(city, address["City"].ToObject()); + Assert.Equal(street, address["Street"].ToObject()); + } + + private async Task RestoreData(string suffix) + { + string requestUri = GetFullUrl($"ResetDataSource{suffix}"); + HttpClient client = new HttpClient(); + HttpResponseMessage response = await client.GetAsync(requestUri); + response.EnsureSuccessStatusCode(); + } + } + + + public static class Database + { + public static void RestoreData(SampleContext db) + { + db.Database.Delete(); + GenerateData(db); + } + + public static void GenerateData(SampleContext db) + { + for (int i = 0; i < 10; i++) + { + int id = i + 1; + db.Products.Add(new EFProduct + { + Id = id, + Name = $"Product{id}" + }); + } + + db.SaveChanges(); + + for (int i = 0; i < 9; i++) + { + int id = i + 1; + db.Orders.Add(new EFOrder + { + Id = id, + // link order 1 to product 1 and 2, order 2 to product 2 and 3, etc. + Products = db.Products.OrderBy(p => p.Id).Skip(i).Take(2).ToList() + }); + } + + db.SaveChanges(); + + for (int i = 0; i < 3; i++) + { + int id = i + 1; + db.Customers.Add(new EFCustomer + { + Id = id, + Name = $"Customer{id}", + HomeAddress = new EFAddress { City = $"City{id}", Street = $"Street{id}" }, + FavoriteProduct = db.Products.Where(p => p.Id == id).FirstOrDefault(), + // link customer 1 to orders 1 to 3, customer 2 to orders 4 to 6, etc. + Orders = db.Orders.OrderBy(o => o.Id).Skip(i * 3).Take(3).ToList() + }); + } + + db.Customers.Add(new EFCustomer + { + Id = 4, + Name = "Customer4", + HomeAddress = new EFAddress(), + FavoriteProduct = null, + Orders = new List() + }); + + db.SaveChanges(); + } + } + + public class SampleContext : DbContext + { + public static string ConnectionString = @"Data Source=(LocalDb)\MSSQLLocalDB;Integrated Security=True;Initial Catalog=NestedPathsTests"; + + public SampleContext() + : base(ConnectionString) + { + } + + protected override void OnModelCreating(DbModelBuilder modelBuilder) + { + modelBuilder.Entity().HasMany(o => o.Products).WithMany(); + modelBuilder.Entity().HasMany(c => c.Orders).WithMany(); + base.OnModelCreating(modelBuilder); + } + + public DbSet Customers { get; set; } + + public DbSet Orders { get; set; } + + public DbSet Products { get; set; } + } + + + public class EFCustomersController: TestODataController + { + SampleContext _db = new SampleContext(); + + [EnableNestedPaths] + public IQueryable Get() + { + return _db.Customers; + } + + [HttpGet] + [ODataRoute("ResetDataSource-Customer")] + public ITestActionResult ResetDataSource() + { + Database.RestoreData(_db); + return Ok(); + } + } + + public class EFOrdersController: TestODataController + { + SampleContext _db = new SampleContext(); + + [EnableNestedPaths] + [EnableQuery] + public IQueryable Get() + { + return _db.Orders; + } + + [HttpGet] + [ODataRoute("ResetDataSource-Order")] + public ITestActionResult ResetDataSource() + { + Database.RestoreData(_db); + return Ok(); + } + } + + public class EFProductsController: TestODataController + { + SampleContext _db = new SampleContext(); + + [EnableNestedPaths] + public IQueryable Get() + { + return _db.Products; + } + + [HttpGet] + [ODataRoute("ResetDataSource-Product")] + public ITestActionResult ResetDataSource() + { + Database.RestoreData(_db); + return Ok(); + } + } + + public class EFCustomer + { + public int Id { get; set; } + public string Name { get; set; } + public virtual EFAddress HomeAddress { get; set; } + public virtual EFProduct FavoriteProduct { get; set; } + public virtual List Orders { get; set; } + } + + public class EFAddress + { + public string City { get; set; } + public string Street { get; set; } + } + + public class EFOrder + { + public int Id { get; set; } + public virtual List Products { get; set; } + } + + public class EFProduct + { + public int Id { get; set; } + public string Name { get; set; } + } +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/NestedPaths/NestedPathsTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/NestedPaths/NestedPathsTests.cs new file mode 100644 index 0000000000..23cf207769 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/NestedPaths/NestedPathsTests.cs @@ -0,0 +1,544 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Threading.Tasks; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.OData.Edm; +using Microsoft.Test.E2E.AspNet.OData.Common; +using Microsoft.Test.E2E.AspNet.OData.Common.Execution; +using Newtonsoft.Json.Linq; +using Xunit; + +namespace Microsoft.Test.E2E.AspNet.OData.NestedPaths +{ + public class NestedPathsTests: WebHostTestBase + { + public NestedPathsTests(WebHostTestFixture fixture) + : base(fixture) + { } + + protected override void UpdateConfiguration(WebRouteConfiguration configuration) + { + configuration.AddControllers( + typeof(CustomersController), + typeof(TopCustomerController)); + configuration.JsonReferenceLoopHandling = Newtonsoft.Json.ReferenceLoopHandling.Ignore; + configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); + configuration.MapODataServiceRoute("nestedpaths", "nestedpaths", GetEdmModel(configuration)); + } + + private static IEdmModel GetEdmModel(WebRouteConfiguration configuration) + { + var builder = configuration.CreateConventionModelBuilder(); + + builder.EntitySet("Customers"); + builder.Singleton("TopCustomer"); + + return builder.GetEdmModel(); + } + + [Fact] + public async Task FetchingEntitySetWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject result = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(result); + + JsonAssert.ArrayLength(10, "value", result); + JArray customers = (JArray)result["value"]; + + for (int i = 0; i < 10; i++) + { + Assert.Equal(i, customers[i]["Id"].ToObject()); + Assert.Equal($"customer{i}", customers[i]["Name"].ToObject()); + AssertJsonAddress(customers[i]["HomeAddress"] as JObject, $"City{i}", $"Street{i}"); + JsonAssert.ArrayLength(2, "OtherAddresses", customers[i] as JObject); + AssertJsonAddress(customers[i]["OtherAddresses"][0] as JObject, $"CityA{i}", $"StreetA{i}"); + AssertJsonAddress(customers[i]["OtherAddresses"][1] as JObject, $"CityB{i}", $"StreetB{i}"); + } + } + + [Fact] + public async Task FetchingEntityWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(2)", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject customer = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(customer); + + Assert.Equal(2, customer["Id"].ToObject()); + Assert.Equal("customer2", customer["Name"].ToObject()); + AssertJsonAddress(customer["HomeAddress"] as JObject, "City2", "Street2"); + JsonAssert.ArrayLength(2, "OtherAddresses", customer); + AssertJsonAddress(customer["OtherAddresses"][0] as JObject, "CityA2", "StreetA2"); + AssertJsonAddress(customer["OtherAddresses"][1] as JObject, "CityB2", "StreetB2"); + } + + [Fact] + public async Task FetchingEntityPrimitivePropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(2)/Name", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject name = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(name); + + Assert.Equal("customer2", name["value"].ToObject()); + } + + [Fact] + public async Task FetchingPrimitiveCollectionPropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(1)/Hobbies", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject result = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(result); + + JsonAssert.ArrayLength(2, "value", result); + JArray hobbies = (JArray)result["value"]; + + Assert.Equal("Running1", hobbies[0].ToObject()); + Assert.Equal("Swimming1", hobbies[1].ToObject()); + } + + [Fact] + public async Task FetchingComplexPropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(2)/HomeAddress", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject address = JObject.Parse(await response.Content.ReadAsStringAsync()); + AssertJsonAddress(address, "City2", "Street2"); + } + + [Fact] + public async Task FetchingPropertyOfComplexPropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(3)/HomeAddress/Street", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject street = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(street); + + Assert.Equal("Street3", street["value"].ToObject()); + } + + [Fact] + public async Task FetchingComplexCollectionPropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(1)/OtherAddresses", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject result = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(result); + + JsonAssert.ArrayLength(2, "value", result); + JArray addresses = (JArray)result["value"]; + + AssertJsonAddress(addresses[0] as JObject, "CityA1", "StreetA1"); + AssertJsonAddress(addresses[1] as JObject, "CityB1", "StreetB1"); + } + + [Fact] + public async Task FetchingNavigationPropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(2)/FavoriteProduct", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject product = JObject.Parse(await response.Content.ReadAsStringAsync()); + AssertJsonProduct(product, 2, "Product2"); + } + + [Fact] + public async Task FetchingPropertyOfNavigationPropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(2)/FavoriteProduct/Name", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject name = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(name); + + Assert.Equal("Product2", name["value"].ToObject()); + } + + [Fact] + public async Task FetchingCollectionNavigationPropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(1)/Products", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject result = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(result); + + JsonAssert.ArrayLength(2, "value", result); + JArray products = (JArray)result["value"]; + + AssertJsonProduct(products[0] as JObject, 101, "Product101"); + AssertJsonProduct(products[1] as JObject, 102, "Product102"); + } + + [Fact] + public async Task FetchingEntityFromNavigationPropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(2)/Products(102)", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject product = JObject.Parse(await response.Content.ReadAsStringAsync()); + AssertJsonProduct(product, 102, "Product102"); + } + + [Fact] + public async Task FetchingPropertyOfEntityFromCollectionNavigationPropertyWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(2)/Products(103)/Name", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject name = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(name); + + Assert.Equal("Product103", name["value"].ToObject()); + } + + [Fact] + public async Task FetchingSingletonWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/TopCustomer", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject customer = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(customer); + + Assert.Equal(1, customer["Id"].ToObject()); + Assert.Equal("customer1", customer["Name"].ToObject()); + AssertJsonAddress(customer["HomeAddress"] as JObject, "City1", "Street1"); + JsonAssert.ArrayLength(2, "OtherAddresses", customer); + AssertJsonAddress(customer["OtherAddresses"][0] as JObject, "CityA1", "StreetA1"); + AssertJsonAddress(customer["OtherAddresses"][1] as JObject, "CityB1", "StreetB1"); + } + + [Fact] + public async Task NavigatingFromSingletonWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/TopCustomer/Products(101)/Name", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("application/json;odata.metadata=minimal")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + JObject name = JObject.Parse(await response.Content.ReadAsStringAsync()); + Assert.NotNull(name); + + Assert.Equal("Product101", name["value"].ToObject()); + } + + [Fact] + public async Task DollarValueWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(2)/Name/$value", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("text/plain")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + string name = await response.Content.ReadAsStringAsync(); + + Assert.Equal("customer2", name); + } + + [Fact] + public async Task DollarCountWorks() + { + // Arrange + string queryUrl = string.Format("{0}/nestedpaths/Customers(2)/Products/$count", BaseAddress); + HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, queryUrl); + request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse("text/plain")); + HttpClient client = new HttpClient(); + + // Act + HttpResponseMessage response = await client.SendAsync(request); + + // Assert + Assert.NotNull(response); + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + + Assert.NotNull(response.Content); + string count = await response.Content.ReadAsStringAsync(); + + Assert.Equal("2", count); + } + + private static void AssertJsonAddress(JObject address, string city, string street) + { + Assert.NotNull(address); + Assert.Equal(city, address["City"].ToObject()); + Assert.Equal(street, address["Street"].ToObject()); + } + + private static void AssertJsonProduct(JObject product, int id, string name) + { + Assert.NotNull(product); + Assert.Equal(id, product["Id"].ToObject()); + Assert.Equal(name, product["Name"].ToObject()); + } + } + + public class CustomersController + { + public IList Customers { get; set; } + + public CustomersController() + { + Customers = Enumerable.Range(0, 10).Select(i => new Customer + { + Id = i, + Name = $"customer{i}", + Hobbies = new List { $"Running{i}", $"Swimming{i}"}, + HomeAddress = new Address { City = $"City{i}", Street = $"Street{i}" }, + OtherAddresses = new List
() + { + new Address { City = $"CityA{i}", Street = $"StreetA{i}" }, + new Address { City = $"CityB{i}", Street = $"StreetB{i}" } + }, + FavoriteProduct = new Product { Id = i, Name = $"Product{i}" }, + Products = new List + { + new Product { Id = 100 + i, Name = $"Product{100 + i }"}, + new Product { Id = 101 + i, Name = $"Product{101 + i }"} + } + }).ToList(); + } + + [EnableQuery] + [EnableNestedPaths] + public IQueryable Get() + { + return Customers.AsQueryable(); + } + } + + public class TopCustomerController + { + [EnableNestedPaths] + public SingleResult Get() + { + var customer = new Customer + { + Id = 1, + Name = "customer1", + Hobbies = new List { "Running1", "Swimming1" }, + HomeAddress = new Address { City = "City1", Street = "Street1" }, + OtherAddresses = new List
() + { + new Address { City = "CityA1", Street = "StreetA1" }, + new Address { City = "CityB1", Street = "StreetB1" } + }, + FavoriteProduct = new Product { Id = 1, Name = "Product1" }, + Products = new List + { + new Product { Id = 101, Name = "Product101" }, + new Product { Id = 102, Name = "Product102" } + } + }; + + return SingleResult.Create(new Customer[] { customer }.AsQueryable()); + } + } + + public class Customer + { + public int Id { get; set; } + public string Name { get; set; } + public List Hobbies { get; set; } + public Address HomeAddress { get; set; } + public List
OtherAddresses { get; set; } + public Product FavoriteProduct { get; set; } + public List Products { get; set; } + } + + public class Address + { + public string City { get; set; } + public string Street { get; set; } + } + + public class Product + { + public int Id { get; set; } + public string Name { get; set; } + } +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Properties/AssemblyInfo.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Properties/AssemblyInfo.cs index bd6f826702..2e2249cfe5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Properties/AssemblyInfo.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/Properties/AssemblyInfo.cs @@ -1,4 +1,11 @@ -using System.Reflection; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Reflection; using System.Runtime.InteropServices; // General Information about an assembly is controlled through the following diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionController.cs index fcdbe825d5..bf9be9967a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionEdmModel.cs index bd0eeded4f..842a6291ae 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.Test.E2E.AspNet.OData.Common.Execution; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionODataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionODataModel.cs index 44174aeb8a..8e74b8ccfd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionODataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionODataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionTests.cs index e18dc03384..f65bd474b7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Build.AspNetCore3x/QueryValidationBeforeAction/QueryValidationBeforeActionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertController.cs new file mode 100644 index 0000000000..08acfa04d5 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertController.cs @@ -0,0 +1,661 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Net; +using System.Reflection; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Routing; +using Microsoft.OData.Edm; +using Microsoft.Test.E2E.AspNet.OData.BulkOperation; +using Microsoft.Test.E2E.AspNet.OData.Common.Controllers; +using Xunit; + +namespace Microsoft.Test.E2E.AspNet.OData.BulkInsert +{ + public class EmployeesController : TestODataController + { + public EmployeesController() + { + if (null == Employees) + { + InitEmployees(); + } + } + + /// + /// static so that the data is shared among requests. + /// + public static IList Employees = null; + + public static IList EmployeesTypeless = null; + + private List Friends = null; + + + private void InitEmployees() + { + Friends = new List { new Friend { Id = 1, Name = "Test0", Age =33 }, new Friend { Id = 2, Name = "Test1", Orders = new List() { new Order { Id = 1, Price = 2 } } }, new Friend { Id = 3, Name = "Test3" }, new Friend { Id = 4, Name = "Test4" } }; + + Employees = new List + { + new Employee() + { + ID=1, + Name="Name1", + SkillSet=new List{Skill.CSharp,Skill.Sql}, + Gender=Gender.Female, + AccessLevel=AccessLevel.Execute, + NewFriends = new List(){new NewFriend {Id =1, Name ="NewFriendTest1", Age=33, NewOrders= new List() { new NewOrder {Id=1, Price =101 } } } }, + Friends = this.Friends.Where(x=>x.Id ==1 || x.Id==2).ToList() + }, + new Employee() + { + ID=2,Name="Name2", + SkillSet=new List(), + Gender=Gender.Female, + AccessLevel=AccessLevel.Read, + NewFriends = new List(){ new MyNewFriend { Id = 2, MyNewOrders = new List() { new MyNewOrder { Id = 2, Price = 444 , Quantity=2 } } } }, + Friends = this.Friends.Where(x=>x.Id ==3 || x.Id==4).ToList() + }, + new Employee(){ + ID=3,Name="Name3", + SkillSet=new List{Skill.Web,Skill.Sql}, + Gender=Gender.Female, + AccessLevel=AccessLevel.Read|AccessLevel.Write + + }, + }; + } + + private void InitTypeLessEmployees(IEdmEntityType entityType) + { + EmployeesTypeless = new List(); + var emp1 = new EdmEntityObject(entityType); + emp1.TrySetPropertyValue("ID", 1); + emp1.TrySetPropertyValue("Name", "Test1"); + + var friendType = entityType.DeclaredNavigationProperties().First().Type.Definition.AsElementType() as IEdmEntityType; + + var friends = new List(); + var friend1 = new EdmEntityObject(friendType); + friend1.TrySetPropertyValue("Id", 1); + friend1.TrySetPropertyValue("Age", 33); + friend1.TrySetPropertyValue("Name", "Test1"); + + var friend2 = new EdmEntityObject(friendType); + friend2.TrySetPropertyValue("Id", 2); + friend2.TrySetPropertyValue("Name", "Test2"); + + friends.Add(friend1); + friends.Add(friend2); + + emp1.TrySetPropertyValue("UnTypedFriends", friends); + + var emp2 = new EdmEntityObject(entityType); + emp2.TrySetPropertyValue("ID", 2); + emp2.TrySetPropertyValue("Name", "Test2"); + + var friends2 = new List(); + var friend3 = new EdmEntityObject(friendType); + friend3.TrySetPropertyValue("Id", 3); + friend3.TrySetPropertyValue("Name", "Test3"); + + var friend4 = new EdmEntityObject(friendType); + friend4.TrySetPropertyValue("Id", 4); + friend4.TrySetPropertyValue("Name", "Test4"); + + friends2.Add(friend3); + friends2.Add(friend4); + + emp2.TrySetPropertyValue("UnTypedFriends", friends2); + + var emp3 = new EdmEntityObject(entityType); + emp3.TrySetPropertyValue("ID", 3); + emp3.TrySetPropertyValue("Name", "Test3"); + + var friends35 = new List(); + var friend5 = new EdmEntityObject(friendType); + friend5.TrySetPropertyValue("Id", 5); + friend5.TrySetPropertyValue("Name", "Test5"); + + friends35.Add(friend5); + + emp3.TrySetPropertyValue("UnTypedFriends", friends35); + + EmployeesTypeless.Add(emp1); + EmployeesTypeless.Add(emp2); + EmployeesTypeless.Add(emp3); + } + + public DeltaSet PatchWithUsersMethod(DeltaSet friendColl, Employee employee) + { + var changedObjColl = friendColl.Patch(new APIHandlerFactory(employee)); + + return changedObjColl; + } + public EdmChangedObjectCollection PatchWithUsersMethodTypeLess(int key, EdmChangedObjectCollection friendColl) + { + + var entity = Request.GetModel().FindDeclaredType("Microsoft.Test.E2E.AspNet.OData.BulkInsert.UnTypedEmployee") as IEdmEntityType; + InitTypeLessEmployees(entity); + + var entity1 = Request.GetModel().FindDeclaredType("Microsoft.Test.E2E.AspNet.OData.BulkInsert.UnTypedFriend") as IEdmEntityType; + + var changedObjColl = friendColl.Patch(new TypelessAPIHandlerFactory(entity, EmployeesTypeless[key - 1])); + + return changedObjColl; + } + + public EdmChangedObjectCollection EmployeePatchMethodTypeLess(EdmChangedObjectCollection empColl) + { + var entity = Request.GetModel().FindDeclaredType("Microsoft.Test.E2E.AspNet.OData.BulkInsert.UnTypedEmployee") as IEdmEntityType; + InitTypeLessEmployees(entity); + + var changedObjColl = empColl.Patch(new TypelessAPIHandlerFactory(entity)); + ValidateSuccessfulTypeless(); + + return changedObjColl; + } + + private void ValidateSuccessfulTypeless() + { + object obj; + Assert.True(EmployeesTypeless.First().TryGetPropertyValue("UnTypedFriends", out obj)); + + var friends = obj as ICollection; + Assert.NotNull(friends); + + object obj1; + + friends.First().TryGetPropertyValue("Name", out obj1); + + object name; + if (EmployeesTypeless.First().TryGetPropertyValue("Name", out name) && name.ToString() == "Employeeabcd") + { + Assert.Equal("abcd", obj1.ToString()); + + object age; + friends.First().TryGetPropertyValue("Age", out age); + + Assert.Equal(33, (int)age); + } + else + { + Assert.Equal("Friend1", obj1.ToString()); + } + + } + + [EnableQuery(PageSize = 10, MaxExpansionDepth = 5)] + public ITestActionResult Get() + { + return Ok(Employees.AsQueryable()); + } + + public ITestActionResult Get(int key) + { + var emp = Employees.SingleOrDefault(e => e.ID == key); + return Ok(emp); + } + + [ODataRoute("Employees({key})/Friends")] + public ITestActionResult GetFriends(int key) + { + var emp = Employees.SingleOrDefault(e => e.ID == key); + return Ok(emp.Friends); + } + + [ODataRoute("Employees({key})/UnTypedFriends")] + public ITestActionResult GetUnTypedFriends(int key) + { + var entity = Request.GetModel().FindDeclaredType("Microsoft.Test.E2E.AspNet.OData.BulkInsert.UnTypedEmployee") as IEdmEntityType; + InitTypeLessEmployees(entity); + + foreach (var emp in EmployeesTypeless) + { + object obj; + emp.TryGetPropertyValue("ID", out obj); + + if (Equals(key, obj)) + { + object friends; + emp.TryGetPropertyValue("UntypedFriends", out friends); + return Ok(friends); + } + } + return Ok(); + } + + + [ODataRoute("Employees")] + [HttpPatch] + public ITestActionResult PatchEmployees([FromBody] DeltaSet coll) + { + InitEmployees(); + + Assert.NotNull(coll); + + var returncoll = coll.Patch(new APIHandlerFactory()); + + return Ok(returncoll); + } + + + [ODataRoute("Employees({key})/Friends")] + [HttpPatch] + public ITestActionResult PatchFriends(int key, [FromBody] DeltaSet friendColl) + { + InitEmployees(); + + Employee originalEmployee = Employees.SingleOrDefault(c => c.ID == key); + Assert.NotNull(originalEmployee); + + var changedObjColl = friendColl.Patch(originalEmployee.Friends); + + return Ok(changedObjColl); + } + + + [ODataRoute("Employees({key})/NewFriends")] + [HttpPatch] + public ITestActionResult PatchNewFriends(int key, [FromBody] DeltaSet friendColl) + { + InitEmployees(); + + if (key == 1) + { + var deltaSet = PatchWithUsersMethod(friendColl, Employees.First(x => x.ID == key)); + + return Ok(deltaSet); + } + { + Employee originalEmployee = Employees.SingleOrDefault(c => c.ID == key); + Assert.NotNull(originalEmployee); + + var friendCollection = new FriendColl() { new NewFriend { Id = 2, Age = 15 } }; + + var changedObjColl = friendColl.Patch(friendCollection); + + return Ok(changedObjColl); + } + + } + + [ODataRoute("Employees({key})/UnTypedFriends")] + [HttpPatch] + public ITestActionResult PatchUnTypedFriends(int key, [FromBody] EdmChangedObjectCollection friendColl) + { + if (key == 1) + { + var changedObjColl = PatchWithUsersMethodTypeLess(key, friendColl); + + var emp = EmployeesTypeless[key - 1]; + object obj; + emp.TryGetPropertyValue("UnTypedFriends", out obj); + var lst = obj as List; + + if (lst != null && lst.Count > 1) + { + object obj1; + if (lst[1].TryGetPropertyValue("Name", out obj1) && Equals("Friend007", obj1)) + { + lst[1].TryGetPropertyValue("Address", out obj1); + Assert.NotNull(obj1); + object obj2; + (obj1 as EdmStructuredObject).TryGetPropertyValue("Street", out obj2); + + Assert.Equal("Abc 123", obj2); + + } + } + + return Ok(changedObjColl); + } + else if (key == 2) + { + var entitytype = Request.GetModel().FindDeclaredType("Microsoft.Test.E2E.AspNet.OData.BulkInsert.UnTypedEmployee") as IEdmEntityType; + var entity = new EdmEntityObject(friendColl[0].GetEdmType().AsEntity()); + entity.TrySetPropertyValue("Id", 2); + + var friendCollection = new FriendColl() { entity }; + + var changedObjColl = PatchWithUsersMethodTypeLess(key, friendColl); + + object obj; + Assert.Single(changedObjColl); + + changedObjColl.First().TryGetPropertyValue("Age", out obj); + Assert.Equal(35, obj); + + return Ok(changedObjColl); + } + else + { + var changedObjColl = PatchWithUsersMethodTypeLess(key, friendColl); + + return Ok(changedObjColl); + } + } + + + [ODataRoute("UnTypedEmployees")] + [HttpPatch] + public ITestActionResult PatchUnTypedEmployees([FromBody] EdmChangedObjectCollection empColl) + { + + var changedObjColl = EmployeePatchMethodTypeLess(empColl); + + return Ok(changedObjColl); + + } + + + + [ODataRoute("Employees({key})")] + public ITestActionResult Patch(int key, [FromBody] Delta delta) + { + InitEmployees(); + + delta.TrySetPropertyValue("ID", key); // It is the key property, and should not be updated. + + Employee employee = Employees.FirstOrDefault(e => e.ID == key); + + if (employee == null) + { + employee = new Employee(); + delta.Patch(employee, new APIHandlerFactory()); + return Created(employee); + } + + try + { + delta.Patch(employee, new APIHandlerFactory()); + + if (employee.Name == "Bind1") + { + Assert.NotNull(employee.Friends.Single(x => x.Id == 3)); + } + } + catch (ArgumentException ae) + { + return BadRequest(ae.Message); + } + + return Ok(employee); + } + + + } + + public class CompanyController : TestODataController + { + public static IList Companies = null; + public static IList OverdueOrders = null; + public static IList MyOverdueOrders = null; + + public CompanyController() + { + if (null == Companies) + { + InitCompanies(); + } + } + + private void InitCompanies() + { + OverdueOrders = new List() { new NewOrder { Id = 1, Price = 10, Quantity =1 }, new NewOrder { Id = 2, Price = 20, Quantity = 2 }, new NewOrder { Id = 3, Price = 30 }, new NewOrder { Id = 4, Price = 40 } }; + MyOverdueOrders = new List() { new MyNewOrder { Id = 1, Price = 10, Quantity = 1 }, new MyNewOrder { Id = 2, Price = 20, Quantity = 2 }, new MyNewOrder { Id = 3, Price = 30 }, new MyNewOrder { Id = 4, Price = 40 } }; + + Companies = new List() { new Company { Id = 1, Name = "Company1", OverdueOrders = OverdueOrders.Where(x => x.Id == 2).ToList(), MyOverdueOrders = MyOverdueOrders.Where(x => x.Id == 2).ToList() } , + new Company { Id = 2, Name = "Company2", OverdueOrders = OverdueOrders.Where(x => x.Id == 3 || x.Id == 4).ToList() } }; + } + + + [ODataRoute("Companies")] + [HttpPatch] + public ITestActionResult PatchCompanies([FromBody] DeltaSet coll) + { + var empCntrl = new EmployeesController(); + InitCompanies(); + + Assert.NotNull(coll); + + var returncoll = coll.Patch( new APIHandlerFactory()); + + var comp = coll.First() as Delta; + object val; + if(comp.TryGetPropertyValue("Name", out val)) + { + if(val.ToString() == "Company02") + { + ValidateOverdueOrders2(1, 2, 9); + } + else + { + ValidateOverdueOrders1(1, 1, 9); + } + } + + + return Ok(returncoll); + } + + [ODataRoute("Companies")] + [HttpPost] + public ITestActionResult Post([FromBody] Company company) + { + + InitCompanies(); + InitEmployees(); + + if(company.Id == 4) + { + AddNewOrder(company); + } + + //MapOdataId(company); + CheckAndApplyODataId(company ); + + Companies.Add(company); + + if (company.Id == 4) + { + ValidateOverdueOrders1(4, 4, 0, 30); + } + else + { + ValidateOverdueOrders1(3, 1); + } + + + return Ok(company); + } + + private static void AddNewOrder(Company company) + { + var newOrder = new NewOrder { Id = 4, Price = company.OverdueOrders[1].Price, Quantity = company.OverdueOrders[1].Quantity }; + OverdueOrders.Add(newOrder); + company.OverdueOrders[1] = newOrder; + } + + + private void MapOdataId(Company company) + { + //More generic. + for(int i =0; i< company.OverdueOrders.Count;i++) + { + var order = company.OverdueOrders[i]; + if(order.Container != null) + { + var pathItems = order.Container.ODataIdNavigationPath.GetNavigationPathItems(); + + int cnt = 0; + if(pathItems[cnt].Name== "Employees") + { + var emp = GetEmployee(pathItems[cnt].KeyProperties); + + if(emp != null) + { + if(pathItems[++cnt].Name == "NewFriends") + { + var frnd = GetNewFriendFromEmployee(emp, pathItems[cnt].KeyProperties); + + if(frnd!= null) + { + if (pathItems[++cnt].Name == "NewOrders") + { + //{ ID= 1, OdataIdContainer {....}} - add comments. + company.OverdueOrders[i] = GetNewOrderFromNewFriend(frnd, pathItems[cnt].KeyProperties); + } + } + } + } + } + + } + } + } + + + + private void CheckAndApplyODataId(object obj) + { + Type type = obj.GetType(); + + PropertyInfo property = type.GetProperties().FirstOrDefault(s => s.PropertyType == typeof(ODataIdContainer)); + + if(property != null && property.GetValue(obj) is ODataIdContainer container && container != null) + { + var res = ApplyODataId(container); + + foreach(var prop in type.GetProperties()) + { + var resVal = prop.GetValue(res); + + + if(resVal != null) + { + prop.SetValue(obj, resVal); + } + } + } + else + { + foreach (var prop in type.GetProperties().Where(p=> p.PropertyType.IsGenericType && typeof(IEnumerable).IsAssignableFrom(p.PropertyType))) + { + var lst = (IEnumerable)prop.GetValue(obj) ; + if(lst == null) + { + continue; + } + + foreach (var val in lst) + { + if (val.GetType().IsPrimitive) + { + break; + } + + CheckAndApplyODataId(val); + + } + } + } + + } + + private object ApplyODataId(ODataIdContainer container) + { + var pathItems = container.ODataIdNavigationPath.GetNavigationPathItems(); + if(pathItems != null) + { + int cnt = 0; + object value = null; + + while(cnt< pathItems.Length) + { + value = GetObject(pathItems[cnt].Name, value, pathItems[cnt].KeyProperties); + cnt++; + } + + return value; + } + + return null; + } + + private object GetObject(string name, object parent, Dictionary keyValues) + { + switch (name) + { + case "Employees": + return EmployeesController.Employees.FirstOrDefault(x => x.ID == (int)keyValues["ID"]); + case "NewFriends": + Employee emp = parent as Employee; + + return emp == null? null: emp.NewFriends.FirstOrDefault(x => x.Id == (int)keyValues["Id"]); + case "NewOrders": + NewFriend frnd = parent as NewFriend; + + return frnd == null ? null : frnd.NewOrders.FirstOrDefault(x => x.Id == (int)keyValues["Id"]); + default: + return null; + } + } + + private Employee GetEmployee(Dictionary keyValues) + { + var emp = EmployeesController.Employees.FirstOrDefault(x => x.ID == (int)keyValues["ID"]); + + return emp; + } + + private NewFriend GetNewFriendFromEmployee(Employee emp, Dictionary keyValues) + { + var frnd = emp.NewFriends.FirstOrDefault(x => x.Id == (int)keyValues["Id"]); + + return frnd; + } + + private NewOrder GetNewOrderFromNewFriend(NewFriend frnd, Dictionary keyValues) + { + var order = frnd.NewOrders.FirstOrDefault(x => x.Id == (int)keyValues["Id"]); + + return order; + } + + private void InitEmployees() + { + var cntrl = new EmployeesController(); + } + + private void ValidateOverdueOrders1(int companyId, int orderId, int quantity = 0, int price=101) + { + var comp = Companies.FirstOrDefault(x => x.Id == companyId); + Assert.NotNull(comp); + + NewOrder order = comp.OverdueOrders.FirstOrDefault(x => x.Id == orderId); + Assert.NotNull(order); + Assert.Equal(orderId, order.Id); + Assert.Equal(price, order.Price); + Assert.Equal(quantity, order.Quantity); + } + + private void ValidateOverdueOrders2(int companyId, int orderId, int quantity = 0) + { + var comp = Companies.FirstOrDefault(x => x.Id == companyId); + Assert.NotNull(comp); + + MyNewOrder order = comp.MyOverdueOrders.FirstOrDefault(x => x.Id == orderId); + Assert.NotNull(order); + Assert.Equal(orderId, order.Id); + Assert.Equal(444, order.Price); + Assert.Equal(quantity, order.Quantity); + } + } +} \ No newline at end of file diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertDataModel.cs new file mode 100644 index 0000000000..76cbcb9301 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertDataModel.cs @@ -0,0 +1,226 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Builder; + +namespace Microsoft.Test.E2E.AspNet.OData.BulkInsert +{ + public class Employee + { + [Key] + public int ID { get; set; } + public String Name { get; set; } + public List SkillSet { get; set; } + public Gender Gender { get; set; } + public AccessLevel AccessLevel { get; set; } + + [AutoExpand] + public List Friends { get; set; } + + public List NewFriends { get; set; } + + public List UnTypedFriends { get; set; } + + public IODataInstanceAnnotationContainer InstanceAnnotations { get; set; } + } + + [Flags] + public enum AccessLevel + { + Read = 1, + Write = 2, + Execute = 4 + } + + public enum Gender + { + Male = 1, + Female = 2 + } + + public enum Skill + { + CSharp, + Sql, + Web, + } + + public enum Sport + { + Pingpong, + Basketball + } + + public class Friend + { + [Key] + public int Id { get; set; } + [Required] + public string Name { get; set; } + [Range(10, 20)] + public int Age { get; set; } + + public List Orders { get; set; } + + } + + + public class Order + { + [Key] + public int Id { get; set; } + + public int Price { get; set; } + } + + public class NewFriend + { + [Key] + public int Id { get; set; } + + public string Name { get; set; } + + public int Age { get; set; } + public IODataInstanceAnnotationContainer InstanceAnnotations { get; set; } + + [Contained] + public List NewOrders { get; set; } + + } + + public class MyNewFriend: NewFriend + { + public string MyName { get; set; } + + [Contained] + public List MyNewOrders { get; set; } + } + + public class MyNewOrder + { + [Key] + public int Id { get; set; } + + public int Price { get; set; } + + public int Quantity { get; set; } + + public ODataIdContainer Container { get; set; } + } + + public class NewOrder + { + [Key] + public int Id { get; set; } + + public int Price { get; set; } + + public int Quantity { get; set; } + + public ODataIdContainer Container {get;set;} + } + + + public class Company + { + [Key] + public int Id { get; set; } + + public string Name { get; set; } + + public List OverdueOrders { get; set; } + + public List MyOverdueOrders { get; set; } + } + + public class UnTypedEmployee + { + [Key] + public int ID { get; set; } + public String Name { get; set; } + + public List UnTypedFriends { get; set; } + } + + public class UnTypedFriend + { + [Key] + public int Id { get; set; } + + public string Name { get; set; } + + public int Age { get; set; } + + public UnTypedAddress Address { get; set; } + + public IODataInstanceAnnotationContainer InstanceAnnotations { get; set; } + } + + public class UnTypedAddress + { + [Key] + public int Id { get; set; } + + public string Street { get; set; } + } + + public class FriendColl : ICollection + { + public FriendColl() { _items = new List(); } + + private IList _items; + + public int Count => _items.Count; + + public bool IsReadOnly => _items.IsReadOnly; + + public void Add(T item) + { + var _item = item as NewFriend; + if (_item != null && _item.Age < 10) + { + throw new NotImplementedException(); + } + + _items.Add(item); + } + + public void Clear() + { + _items.Clear(); + } + + public bool Contains(T item) + { + return _items.Contains(item); + } + + public void CopyTo(T[] array, int arrayIndex) + { + _items.CopyTo(array, arrayIndex); + } + + public IEnumerator GetEnumerator() + { + return _items.GetEnumerator(); + } + + public bool Remove(T item) + { + throw new NotImplementedException(); + + //return _items.Remove(item); + } + + IEnumerator IEnumerable.GetEnumerator() + { + return ((IEnumerable)_items).GetEnumerator(); + } + } + +} \ No newline at end of file diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertEdmModel.cs new file mode 100644 index 0000000000..88fa414c05 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertEdmModel.cs @@ -0,0 +1,107 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using Microsoft.AspNet.OData.Builder; +using Microsoft.OData.Edm; +using Microsoft.Test.E2E.AspNet.OData.Common.Execution; + +namespace Microsoft.Test.E2E.AspNet.OData.BulkInsert +{ + internal class BulkInsertEdmModel + { + public static IEdmModel GetExplicitModel(WebRouteConfiguration configuration) + { + ODataModelBuilder builder = new ODataModelBuilder(); + var employee = builder.EntityType(); + employee.HasKey(c => c.ID); + employee.Property(c => c.Name); + employee.CollectionProperty(c => c.SkillSet); + employee.EnumProperty(c => c.Gender); + employee.EnumProperty(c => c.AccessLevel); + + employee.CollectionProperty(c => c.Friends); + employee.CollectionProperty(c => c.NewFriends); + employee.CollectionProperty(c => c.UnTypedFriends); + + + var skill = builder.EnumType(); + skill.Member(Skill.CSharp); + skill.Member(Skill.Sql); + skill.Member(Skill.Web); + + var gender = builder.EnumType(); + gender.Member(Gender.Female); + gender.Member(Gender.Male); + + var accessLevel = builder.EnumType(); + accessLevel.Member(AccessLevel.Execute); + accessLevel.Member(AccessLevel.Read); + accessLevel.Member(AccessLevel.Write); + + var sport = builder.EnumType(); + sport.Member(Sport.Basketball); + sport.Member(Sport.Pingpong); + + AddBoundActionsAndFunctions(employee); + AddUnboundActionsAndFunctions(builder); + + EntitySetConfiguration employees = builder.EntitySet("Employees"); + builder.Namespace = typeof(Employee).Namespace; + return builder.GetEdmModel(); + } + + public static IEdmModel GetConventionModel(WebRouteConfiguration configuration) + { + ODataConventionModelBuilder builder = configuration.CreateConventionModelBuilder(); + EntitySetConfiguration employees = builder.EntitySet("Employees"); + EntityTypeConfiguration employee = employees.EntityType; + + EntitySetConfiguration friends = builder.EntitySet("Friends"); + EntitySetConfiguration orders = builder.EntitySet("Orders"); + EntitySetConfiguration fnewriends = builder.EntitySet("NewFriends"); + EntitySetConfiguration funtypenewriends = builder.EntitySet("UnTypedFriends"); + EntitySetConfiguration addresses = builder.EntitySet("Address"); + + EntitySetConfiguration unemployees = builder.EntitySet("UnTypedEmployees"); + EntityTypeConfiguration unemployee = unemployees.EntityType; + + EntitySetConfiguration companies = builder.EntitySet("Companies"); + EntitySetConfiguration overdueorders = builder.EntitySet("OverdueOrders"); + EntitySetConfiguration myoverdueorders = builder.EntitySet("MyOverdueOrders"); + EntitySetConfiguration myNewOrders = builder.EntitySet("MyNewOrders"); + + // maybe following lines are not required once bug #1587 is fixed. + // 1587: It's better to support automatically adding actions and functions in ODataConventionModelBuilder. + AddBoundActionsAndFunctions(employee); + AddUnboundActionsAndFunctions(builder); + + builder.Namespace = typeof(Employee).Namespace; + + var edmModel = builder.GetEdmModel(); + return edmModel; + } + + private static void AddBoundActionsAndFunctions(EntityTypeConfiguration employee) + { + var actionConfiguration = employee.Action("AddSkill"); + actionConfiguration.Parameter("skill"); + actionConfiguration.ReturnsCollection(); + + var functionConfiguration = employee.Function("GetAccessLevel"); + functionConfiguration.Returns(); + } + + private static void AddUnboundActionsAndFunctions(ODataModelBuilder odataModelBuilder) + { + var actionConfiguration = odataModelBuilder.Action("SetAccessLevel"); + actionConfiguration.Parameter("ID"); + actionConfiguration.Parameter("accessLevel"); + actionConfiguration.Returns(); + + var functionConfiguration = odataModelBuilder.Function("HasAccessLevel"); + functionConfiguration.Parameter("ID"); + functionConfiguration.Parameter("AccessLevel"); + functionConfiguration.Returns(); + } + } +} \ No newline at end of file diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertTest.cs new file mode 100644 index 0000000000..434f060a56 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkInsertTest.cs @@ -0,0 +1,959 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Net.Http.Headers; +using System.Text; +using System.Threading.Tasks; +using Microsoft.AspNet.OData; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Routing; +using Microsoft.AspNet.OData.Routing.Conventions; +using Microsoft.OData; +using Microsoft.OData.Edm; +using Microsoft.Test.E2E.AspNet.OData.Common.Execution; +using Microsoft.Test.E2E.AspNet.OData.Common.Extensions; +using Microsoft.Test.E2E.AspNet.OData.ModelBuilder; +using Newtonsoft.Json.Linq; +using Xunit; + +namespace Microsoft.Test.E2E.AspNet.OData.BulkInsert +{ + public class BulkInsertTest : WebHostTestBase + { + public BulkInsertTest(WebHostTestFixture fixture) + :base(fixture) + { + } + + protected override void UpdateConfiguration(WebRouteConfiguration configuration) + { + var controllers = new[] { typeof(EmployeesController), typeof(CompanyController), typeof(MetadataController) }; + configuration.AddControllers(controllers); + + configuration.Routes.Clear(); + configuration.Count().Filter().OrderBy().Expand().MaxTop(null).Select(); + configuration.MapODataServiceRoute("convention", "convention", BulkInsertEdmModel.GetConventionModel(configuration)); + configuration.MapODataServiceRoute("explicit", "explicit", BulkInsertEdmModel.GetExplicitModel(configuration), new DefaultODataPathHandler(), ODataRoutingConventions.CreateDefault()); + configuration.EnsureInitialized(); + } + + + #region Update + + [Fact] + public async Task PatchEmployee_WithUpdates() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'Sql' , + 'Friends@odata.delta':[{'Id':1,'Name':'Test2'},{'Id':2,'Name':'Test3'}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Equal(2, result.Count); + Assert.Contains("Test2", result.ToString()); + } + + } + + [Fact] + public async Task PatchEmployee_WithUpdates_WithEmployees() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'Sql' , + 'Friends':[{'Id':345,'Name':'Test2'},{'Id':400,'Name':'Test3'},{'Id':900,'Name':'Test93'}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Equal(3, result.Count); + Assert.Contains("345", result.ToString()); + Assert.Contains("400", result.ToString()); + Assert.Contains("900", result.ToString()); + } + + } + + + [Fact] + public async Task PatchEmployee_WithUpdates_Friends() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + + var content = @"{'@odata.type': '#Microsoft.Test.E2E.AspNet.OData.BulkInsert.Friend', + '@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(1)/Friends/$delta', + 'value':[{ 'Id':1,'Name':'Friend1'}, { 'Id':2,'Name':'Friend2'}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Equal(2, result.Count); + Assert.Contains("Friend1", result.ToString()); + Assert.Contains("Friend2", result.ToString()); + } + } + + [Fact] + public async Task PatchEmployee_WithDeletes_Friends() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(1)/Friends/$delta', + 'value':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ 'Id':2,'Name':'Friend2'}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Single(result); + Assert.Contains("Friend2", result.ToString()); + } + + } + + [Fact] + public async Task PatchEmployee_WithDeletes_Friends_WithNestedTypes() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(1)/Friends/$delta', '@odata.type': '#Microsoft.Test.E2E.AspNet.OData.BulkInsert.Friend', + 'value':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1, 'Orders@odata.delta' :[{'Id':1,'Price': 10}, {'Id':2,'Price': 20} ] },{ 'Id':2,'Name':'Friend2'}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Single(result); + Assert.Contains("Friend2", result.ToString()); + } + + } + + [Fact] + public async Task PatchEmployee_WithDeletes_Friends_WithNestedDeletes() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(1)/Friends/$delta', '@odata.type': '#Microsoft.Test.E2E.AspNet.OData.BulkInsert.Friend', + 'value':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1, 'Orders@odata.delta' :[{'@odata.removed' : {'reason':'changed'}, 'Id':1,'Price': 10}, {'Id':2,'Price': 20} ] },{ 'Id':2,'Name':'Friend2'}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Contains("Friend2", result.ToString()); + } + + } + + [Fact] + public async Task PatchEmployee_WithAdds_Friends_WithAnnotations() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)/NewFriends"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(1)/NewFriends/$delta', + 'value':[{ 'Id':3, 'Age':35, '@NS.Test':1}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + requestForPost.Content = new StringContent(content); + + requestForPost.Content.Headers.ContentType= MediaTypeWithQualityHeaderValue.Parse("application/json"); + // StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + //requestForPost.Content = stringContent; + + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + json.ToString().Contains("$deletedEntity"); + } + } + + [Fact] + public async Task PatchEmployee_WithFailedAdds_Friends() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)/NewFriends"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(1)/NewFriends/$delta', + 'value':[{ 'Id':3, 'Age':3, '@NS.Test':1}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + json.ToString().Contains("$deletedEntity"); + } + } + + [Fact] + public async Task PatchEmployee_WithFailedDeletes_Friends() + { + //Arrange + string requestUri = this.BaseAddress + "/convention/Employees(2)/NewFriends"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(1)/NewFriends/$delta', + 'value':[{ '@odata.removed' : {'reason':'changed'}, 'Id':2, '@NS.Test':1}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Contains("$delta", json); + } + + } + + + [Fact] + public async Task PatchEmployee_WithFailedOperation_WithAnnotations() + { + //Arrange + string requestUri = this.BaseAddress + "/convention/Employees(2)/NewFriends"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(2)/NewFriends/$delta', + 'value':[{ '@odata.removed' : {'reason':'changed'}, 'Id':2, '@Core.ContentID':3, '@NS.Test2':'testing'}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var str = json.ToString(); + Assert.Contains("$delta",str); + Assert.Contains("NS.Test2", str); + Assert.Contains("Core.DataModificationException", str); + } + + } + + + [Fact] + public async Task PatchUntypedEmployee_WithAdds_Friends_Untyped() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/UnTypedEmployees"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(2)/UnTypedFriends/$delta', + 'value':[{ 'Id':3, 'Age':35,}] + }"; + + content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#UnTypedEmployees/$delta', + 'value':[{ 'ID':1,'Name':'Employee1', + 'UnTypedFriends@odata.delta':[{'Id':1,'Name':'Friend1'},{'Id':2,'Name':'Friend2'}] + }, + { 'ID':2,'Name':'Employee2', + 'UnTypedFriends@odata.delta':[{'Id':3,'Name':'Friend3'},{'Id':4,'Name':'Friend4'}] + }] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + json.ToString().Contains("$deletedEntity"); + } + } + + + [Fact] + public async Task PatchEmployee_WithAdds_Friends_WithNested_Untyped() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)/UnTypedFriends"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(1)/UnTypedFriends/$delta', + 'value':[{ 'Id':2, 'Name': 'Friend007', 'Age':35,'Address@odata.delta':{'Id':1, 'Street' : 'Abc 123'}, '@NS.Test':1}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + json.ToString().Contains("$delta"); + json.ToString().Contains("@NS.Test"); + } + + } + + + [Fact] + public async Task PatchEmployee_WithAdds_Friends_WithAnnotations_Untyped() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(2)/UnTypedFriends"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(2)/UnTypedFriends/$delta', + 'value':[{ 'Id':2, 'Age':35, '@NS.Test':1}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + json.ToString().Contains("$delta"); + json.ToString().Contains("@NS.Test"); + } + } + + [Fact] + public async Task PatchEmployee_WithFailedAdds_Friends_Untyped() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(3)/UnTypedFriends"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(3)/UnTypedFriends/$delta', + 'value':[{ 'Id':3, 'Age':3, '@NS.Test':1}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + json.ToString().Contains("$deletedEntity"); + } + } + + [Fact] + public async Task PatchEmployee_WithFailedDeletes_Friends_Untyped() + { + //Arrange + string requestUri = this.BaseAddress + "/convention/Employees(3)/UnTypedFriends"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(3)/UnTypedFriends/$delta', + 'value':[{ '@odata.removed' : {'reason':'changed'}, 'Id':5, '@NS.Test':1}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Contains("@Core.DataModificationException", json.ToString()); + Assert.Contains("@NS.Test", json.ToString()); + } + + } + + + [Fact] + public async Task PatchEmployee_WithFailedOperation_WithAnnotations_Untyped() + { + //Arrange + string requestUri = this.BaseAddress + "/convention/Employees(3)/UnTypedFriends"; + //{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{ '@odata.removed' : {'reason':'deleted'}, 'Id':2}, + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Employees(3)/UnTypedFriends/$delta', + 'value':[{ '@odata.removed' : {'reason':'changed'}, 'Id':5, '@Core.ContentID':3, '@NS.Test2':'testing'}] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + var str = json.ToString(); + Assert.Contains("$delta", str); + Assert.Contains("NS.Test2", str); + Assert.Contains("Core.DataModificationException", str); + Assert.Contains("Core.ContentID", str); + } + + } + + [Fact] + public async Task PatchEmployee_WithUpdates_Employees() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees"; + + var content = @"{'@odata.context':'"+ this.BaseAddress + @"/convention/$metadata#Employees/$delta', + 'value':[{ '@odata.type': '#Microsoft.Test.E2E.AspNet.OData.BulkInsert.Employee', 'ID':1,'Name':'Employee1', + 'Friends@odata.delta':[{'Id':1,'Name':'Friend1', + 'Orders@odata.delta' :[{'Id':1,'Price': 10}, {'Id':2,'Price': 20} ] },{'Id':2,'Name':'Friend2'}] + }, + { '@odata.type': '#Microsoft.Test.E2E.AspNet.OData.BulkInsert.Employee', 'ID':2,'Name':'Employee2', + 'Friends@odata.delta':[{'Id':3,'Name':'Friend3', + 'Orders@odata.delta' :[{'Id':3,'Price': 30}, {'Id':4,'Price': 40} ]},{'Id':4,'Name':'Friend4'}] + }] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = response.Content.ReadAsStringAsync().Result; + + Assert.Contains("Friend1", json.ToString()); + Assert.Contains("Friend2", json.ToString()); + } + + requestUri = this.BaseAddress + "/convention/Employees(2)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = response.Content.ReadAsStringAsync().Result; + + Assert.Contains("Friend3", json.ToString()); + Assert.Contains("Friend4", json.ToString()); + } + } + + + [Fact] + public async Task PatchEmployee_WithDelete() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'Sql' , + 'Friends@odata.delta':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Single(result); + Assert.DoesNotContain("Test0", result.ToString()); + } + } + + [Fact] + public async Task PatchEmployee_WithODataBind() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'Bind1' , + 'Friends@odata.bind':['Friends(3)'] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + + + } + + + [Fact] + public async Task PatchEmployee_WithAddUpdateAndDelete() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'Sql' , + 'Friends@odata.delta':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{'Id':2,'Name':'Test3'},{'Id':3,'Name':'Test4'}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Equal(2, result.Count); + Assert.DoesNotContain("Test0", result.ToString()); + Assert.Contains("Test3", result.ToString()); + Assert.Contains("Test4", result.ToString()); + } + } + + + [Fact] + public async Task PatchEmployee_WithMultipleUpdatesinOrder1() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'Sql' , + 'Friends@odata.delta':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{'Id':1,'Name':'Test_1'},{'Id':2,'Name':'Test3'},{'Id':3,'Name':'Test4'}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Equal(3, result.Count); + Assert.DoesNotContain("Test0", result.ToString()); + Assert.Contains("Test_1", result.ToString()); + Assert.Contains("Test3", result.ToString()); + Assert.Contains("Test4", result.ToString()); + } + } + + [Fact] + public async Task PatchEmployee_WithMultipleUpdatesinOrder2() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Employees(1)"; + + var content = @"{ + 'Name':'Sql' , + 'Friends@odata.delta':[{ '@odata.removed' : {'reason':'changed'}, 'Id':1},{'Id':1,'Name':'Test_1'},{'Id':2,'Name':'Test3'},{'Id':3,'Name':'Test4'},{ '@odata.removed' : {'reason':'changed'}, 'Id':1}] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + //Assert + requestUri = this.BaseAddress + "/convention/Employees(1)/Friends"; + using (HttpResponseMessage response = await this.Client.GetAsync(requestUri)) + { + response.EnsureSuccessStatusCode(); + + var json = await response.Content.ReadAsObject(); + var result = json.GetValue("value") as JArray; + + Assert.Equal(2, result.Count); + Assert.DoesNotContain("Test0", result.ToString()); + Assert.DoesNotContain("Test_1", result.ToString()); + Assert.Contains("Test3", result.ToString()); + Assert.Contains("Test4", result.ToString()); + } + } + + + [Fact] + public async Task PatchCompanies_WithUpdates_ODataId() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Companies"; + + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Companies/$delta', + 'value':[{ '@odata.type': '#Microsoft.Test.E2E.AspNet.OData.BulkInsert.Company', 'Id':1,'Name':'Company01', + 'OverdueOrders@odata.delta':[{'@odata.id':'Employees(1)/NewFriends(1)/NewOrders(1)', 'Quantity': 9}] + + }] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + + } + + [Fact] + public async Task PatchCompanies_WithUpdates_ODataId_WithCast() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Companies"; + + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#Companies/$delta', + 'value':[{ '@odata.type': '#Microsoft.Test.E2E.AspNet.OData.BulkInsert.Company', 'Id':1,'Name':'Company02', + 'MyOverdueOrders@odata.delta':[{'@odata.id':'Employees(2)/NewFriends(2)/Microsoft.Test.E2E.AspNet.OData.BulkInsert.MyNewFriend/MyNewOrders(2)', 'Quantity': 9}] + + }] + }"; + + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + + } + + + [Fact] + public async Task PatchUntypedEmployee_WithOdataId() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/UnTypedEmployees"; + + var content = @"{'@odata.context':'" + this.BaseAddress + @"/convention/$metadata#UnTypedEmployees/$delta', + 'value':[{ 'ID':1,'Name':'Employeeabcd', + 'UnTypedFriends@odata.delta':[{'@odata.id':'UnTypedEmployees(1)/UnTypedFriends(1)', 'Name':'abcd'}] + }] + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("PATCH"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + Client.DefaultRequestHeaders.Add("Prefer", @"odata.include-annotations=""*"""); + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + json.ToString().Contains("$deletedEntity"); + } + } + + [Fact] + public async Task PostCompany_WithODataId() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Companies"; + + var content = @"{'Id':3,'Name':'Company03', + 'OverdueOrders':[{'@odata.id':'Employees(1)/NewFriends(1)/NewOrders(1)'}] + + + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("POST"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + } + + + [Fact] + public async Task PostCompany_WithODataId_AndWithout() + { + //Arrange + + string requestUri = this.BaseAddress + "/convention/Companies"; + + var content = @"{'Id':4,'Name':'Company04', + 'OverdueOrders':[{'@odata.id':'Employees(1)/NewFriends(1)/NewOrders(1)'},{Price:30}] + + + }"; + + var requestForPost = new HttpRequestMessage(new HttpMethod("POST"), requestUri); + + StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); + requestForPost.Content = stringContent; + + //Act & Assert + using (HttpResponseMessage response = await this.Client.SendAsync(requestForPost)) + { + var json = response.Content.ReadAsStringAsync().Result; + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + } + + } + + + + #endregion + + } +} \ No newline at end of file diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkOperationPatchHandlers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkOperationPatchHandlers.cs new file mode 100644 index 0000000000..8e53bc8f27 --- /dev/null +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/BulkOperation/BulkOperationPatchHandlers.cs @@ -0,0 +1,1316 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.AspNet.OData; +using Microsoft.OData.Edm; +using Microsoft.Test.E2E.AspNet.OData.BulkInsert; + +namespace Microsoft.Test.E2E.AspNet.OData.BulkOperation +{ + public class APIHandlerFactory : ODataAPIHandlerFactory + { + Employee employee; + public APIHandlerFactory() + { + + } + + public APIHandlerFactory(Employee employee) + { + this.employee = employee; + } + + public override IODataAPIHandler GetHandler(NavigationPath navigationPath) + { + if(navigationPath != null) + { + var pathItems = navigationPath.GetNavigationPathItems(); + + if(pathItems == null) + { + switch (navigationPath.NavigationPathName) + { + case "Employees": + case "Employee": + return new EmployeeAPIHandler(); + case "NewFriend": + return new NewFriendAPIHandler(employee); + case "Company": + return new CompanyAPIHandler(); + default: + return null; + } + } + + int cnt = 0; + + switch (pathItems[cnt].Name) + { + case "Employees": + { + Employee employee; + string msg; + if ((new EmployeeAPIHandler().TryGet(pathItems[cnt].KeyProperties, out employee, out msg)) == ODataAPIResponseStatus.Success) + { + return GetNestedHandlerForEmployee(pathItems, cnt, employee); + } + } + return null; + + default: + return null; + + } + + } + + return null; + } + + private static IODataAPIHandler GetNestedHandlerForEmployee(PathItem[] pathItems, int cnt, Employee employee) + { + cnt++; + if(pathItems.Length <= cnt) + { + return null; + } + + switch (pathItems[cnt].Name) + { + case "NewFriends": + if (pathItems[cnt].IsCastType) + { + if (pathItems[cnt].CastTypeName == "Microsoft.Test.E2E.AspNet.OData.BulkInsert.MyNewFriend") + { + MyNewFriend friend = employee.NewFriends.FirstOrDefault(x => x.Id == (int)pathItems[cnt].KeyProperties["Id"]) as MyNewFriend; + + if (friend != null) + { + switch (pathItems[++cnt].Name) + { + case "MyNewOrders": + return new MyNewOrderAPIHandler(friend); + + default: + return null; + + } + } + } + } + else + { + NewFriend friend = employee.NewFriends.FirstOrDefault(x => x.Id == (int)pathItems[cnt].KeyProperties["Id"]); + + if (friend != null) + { + switch (pathItems[++cnt].Name) + { + case "NewOrders": + return new NewOrderAPIHandler(friend); + + default: + return null; + + } + } + } + + return null; + + default: + return null; + + } + } + } + + public class TypelessAPIHandlerFactory : ODataEdmAPIHandlerFactory + { + IEdmEntityType entityType; + IEdmStructuredObject employee; + + public TypelessAPIHandlerFactory(IEdmEntityType entityType) + { + this.entityType = entityType; + } + + public TypelessAPIHandlerFactory(IEdmEntityType entityType, IEdmStructuredObject employee) + { + this.entityType = entityType; + this.employee = employee; + } + + public override EdmODataAPIHandler GetHandler(NavigationPath navigationPath) + { + if (navigationPath != null) + { + var pathItems = navigationPath.GetNavigationPathItems(); + int cnt = 0; + + if (pathItems == null) + { + switch (navigationPath.NavigationPathName) + { + case "UnTypedEmployee": + return new EmployeeEdmAPIHandler(entityType); + case "UnTypedFriend": + return new FriendTypelessAPIHandler(employee, entityType); + + default: + return null; + } + } + + switch (pathItems[cnt].Name) + { + case "UnTypedEmployees": + { + IEdmStructuredObject employee; + string msg; + if ((new EmployeeEdmAPIHandler(entityType).TryGet(pathItems[cnt].KeyProperties, out employee, out msg)) == ODataAPIResponseStatus.Success) + { + cnt++; + + if (cnt x.Id == (int)pathItems[cnt].KeyProperties["Id"]) as MyNewFriend; + + if (friend != null) + { + switch (pathItems[++cnt].Name) + { + case "MyNewOrders": + return new MyNewOrderAPIHandler(friend); + + default: + return null; + + } + } + } + } + else + { + NewFriend friend = employee.NewFriends.FirstOrDefault(x => x.Id == (int)pathItems[cnt].KeyProperties["Id"]); + + if (friend != null) + { + switch (pathItems[++cnt].Name) + { + case "NewOrders": + return new NewOrderAPIHandler(friend); + + default: + return null; + + } + } + } + + return null; + + default: + return null; + + } + } + } + + + public class CompanyAPIHandler : ODataAPIHandler + { + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out Company createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new Company(); + CompanyController.Companies.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var company = CompanyController.Companies.First(x => x.Id == Int32.Parse(id)); + + CompanyController.Companies.Remove(company); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out Company originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + originalObject = CompanyController.Companies.First(x => x.Id == Int32.Parse(id)); + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(Company parent, string navigationPropertyName) + { + switch (navigationPropertyName) + { + case "OverdueOrders": + return new OverdueOrderAPIHandler(parent); + case "MyOverdueOrders": + return new MyOverdueOrderAPIHandler(parent); + default: + return null; + } + + } + } + + public class OverdueOrderAPIHandler : ODataAPIHandler + { + Company parent; + + public OverdueOrderAPIHandler(Company parent) + { + this.parent = parent; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out NewOrder createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new NewOrder(); + parent.OverdueOrders.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var newOrders = CompanyController.OverdueOrders.First(x => x.Id == Int32.Parse(id)); + + parent.OverdueOrders.Remove(newOrders); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out NewOrder originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + originalObject = parent.OverdueOrders.FirstOrDefault(x => x.Id == Int32.Parse(id)); + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(NewOrder parent, string navigationPropertyName) + { + switch (navigationPropertyName) + { + + default: + return null; + } + + } + } + + public class MyOverdueOrderAPIHandler : ODataAPIHandler + { + Company parent; + + public MyOverdueOrderAPIHandler(Company parent) + { + this.parent = parent; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out MyNewOrder createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new MyNewOrder(); + parent.MyOverdueOrders.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var newOrders = CompanyController.MyOverdueOrders.First(x => x.Id == Int32.Parse(id)); + + parent.MyOverdueOrders.Remove(newOrders); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out MyNewOrder originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + originalObject = parent.MyOverdueOrders.FirstOrDefault(x => x.Id == Int32.Parse(id)); + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(MyNewOrder parent, string navigationPropertyName) + { + switch (navigationPropertyName) + { + + default: + return null; + } + + } + } + + + public class EmployeeAPIHandler : ODataAPIHandler + { + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out Employee createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new Employee(); + EmployeesController.Employees.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var customer = EmployeesController.Employees.First(x => x.ID == Int32.Parse(id)); + + EmployeesController.Employees.Remove(customer); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out Employee originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["ID"].ToString(); + originalObject = EmployeesController.Employees.First(x => x.ID == Int32.Parse(id)); + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(Employee parent, string navigationPropertyName) + { + switch (navigationPropertyName) + { + case "Friends": + return new FriendAPIHandler(parent); + case "NewFriends": + return new NewFriendAPIHandler(parent); + default: + return null; + } + + } + } + + public class FriendAPIHandler : ODataAPIHandler + { + Employee employee; + public FriendAPIHandler(Employee employee) + { + this.employee = employee; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out Friend createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new Friend(); + employee.Friends.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var friend = employee.Friends.FirstOrDefault(x => x.Id == Int32.Parse(id)); + + employee.Friends.Remove(friend); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out Friend originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + originalObject = employee.Friends.FirstOrDefault(x => x.Id == Int32.Parse(id)); + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(Friend parent, string navigationPropertyName) + { + switch (navigationPropertyName) + { + case "Orders": + return new OrderAPIHandler(parent); + default: + return null; + + } + } + + } + + public class NewOrderAPIHandler : ODataAPIHandler + { + NewFriend friend; + public NewOrderAPIHandler(NewFriend friend) + { + this.friend = friend; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out NewOrder createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new NewOrder(); + + if (friend.NewOrders == null) + { + friend.NewOrders = new List(); + } + + friend.NewOrders.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var friend = this.friend.NewOrders.FirstOrDefault(x => x.Id == int.Parse(id)); + + this.friend.NewOrders.Remove(friend); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out NewOrder originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + if (friend.NewOrders != null) + { + var id = keyValues["Id"].ToString(); + originalObject = friend.NewOrders.FirstOrDefault(x => x.Id == Int32.Parse(id)); + } + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(NewOrder parent, string navigationPropertyName) + { + throw new NotImplementedException(); + } + + } + + public class MyNewOrderAPIHandler : ODataAPIHandler + { + MyNewFriend friend; + public MyNewOrderAPIHandler(MyNewFriend friend) + { + this.friend = friend; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out MyNewOrder createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new MyNewOrder(); + + if (friend.MyNewOrders == null) + { + friend.MyNewOrders = new List(); + } + + friend.MyNewOrders.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var friend = this.friend.MyNewOrders.FirstOrDefault(x => x.Id == int.Parse(id)); + + this.friend.MyNewOrders.Remove(friend); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out MyNewOrder originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + if (friend.MyNewOrders != null) + { + var id = keyValues["Id"].ToString(); + originalObject = friend.MyNewOrders.FirstOrDefault(x => x.Id == Int32.Parse(id)); + } + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(MyNewOrder parent, string navigationPropertyName) + { + throw new NotImplementedException(); + } + + } + + + public class OrderAPIHandler : ODataAPIHandler + { + Friend friend; + public OrderAPIHandler(Friend friend) + { + this.friend = friend; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out Order createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new Order(); + + if(friend.Orders == null) + { + friend.Orders = new List(); + } + + friend.Orders.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var friend = this.friend.Orders.FirstOrDefault(x => x.Id == int.Parse(id)); + + this.friend.Orders.Remove(friend); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out Order originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + if (friend.Orders != null) + { + var id = keyValues["Id"].ToString(); + originalObject = friend.Orders.FirstOrDefault(x => x.Id == Int32.Parse(id)); + } + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(Order parent, string navigationPropertyName) + { + throw new NotImplementedException(); + } + + } + + + + public class NewFriendAPIHandler : ODataAPIHandler + { + Employee employee; + public NewFriendAPIHandler(Employee employee) + { + this.employee = employee; + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out NewFriend createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new NewFriend(); + + if(employee.NewFriends == null) + { + employee.NewFriends = new List(); + } + + employee.NewFriends.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + var friend = employee.NewFriends.First(x => x.Id == Int32.Parse(id)); + + employee.NewFriends.Remove(friend); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out NewFriend originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + + if(employee.NewFriends == null) + { + return ODataAPIResponseStatus.NotFound; + } + + originalObject = employee.NewFriends.FirstOrDefault(x => x.Id == Int32.Parse(id)); + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override IODataAPIHandler GetNestedHandler(NewFriend parent, string navigationPropertyName) + { + throw new NotImplementedException(); + } + + } + + + public class EmployeeEdmAPIHandler : EdmODataAPIHandler + { + IEdmEntityType entityType; + public EmployeeEdmAPIHandler(IEdmEntityType entityType) + { + this.entityType = entityType; + } + + public override ODataAPIResponseStatus TryCreate(IEdmChangedObject changedObject, out IEdmStructuredObject createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new EdmEntityObject(entityType); + EmployeesController.EmployeesTypeless.Add(createdObject as EdmStructuredObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + foreach (var emp in EmployeesController.EmployeesTypeless) + { + object id1; + emp.TryGetPropertyValue("ID", out id1); + + if (id == id1.ToString()) + { + EmployeesController.EmployeesTypeless.Remove(emp); + break; + } + } + + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out IEdmStructuredObject originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["ID"].ToString(); + foreach (var emp in EmployeesController.EmployeesTypeless) + { + object id1; + emp.TryGetPropertyValue("ID", out id1); + + if(id == id1.ToString()) + { + originalObject = emp; + break; + } + } + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override EdmODataAPIHandler GetNestedHandler(IEdmStructuredObject parent, string navigationPropertyName) + { + switch (navigationPropertyName) + { + case "UnTypedFriends": + return new FriendTypelessAPIHandler(parent, entityType.DeclaredNavigationProperties().First().Type.Definition.AsElementType() as IEdmEntityType); + + default: + return null; + } + + } + + } + + public class FriendTypelessAPIHandler : EdmODataAPIHandler + { + IEdmEntityType entityType; + EdmStructuredObject employee; + + public FriendTypelessAPIHandler(IEdmStructuredObject employee, IEdmEntityType entityType) + { + this.employee = employee as EdmStructuredObject; + this.entityType = entityType; + } + + public override ODataAPIResponseStatus TryCreate(IEdmChangedObject changedObject, out IEdmStructuredObject createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + object empid; + if(employee.TryGetPropertyValue("ID" , out empid) && empid as int? == 3) + { + throw new Exception("Testing Error"); + } + + createdObject = new EdmEntityObject(entityType); + object obj; + employee.TryGetPropertyValue("UnTypedFriends", out obj); + + var friends = obj as ICollection; + + if(friends == null) + { + friends = new List(); + } + + friends.Add(createdObject); + + employee.TrySetPropertyValue("UnTypedFriends", friends); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + if(id == "5") + { + throw new Exception("Testing Error"); + } + foreach (var emp in EmployeesController.EmployeesTypeless) + { + object id1; + emp.TryGetPropertyValue("ID", out id1); + + if (id == id1.ToString()) + { + object obj; + employee.TryGetPropertyValue("UnTypedFriends", out obj); + + var friends = obj as IList; + + friends.Remove(emp); + + employee.TrySetPropertyValue("UnTypedFriends", friends); + + break; + } + } + + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out IEdmStructuredObject originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + object obj; + employee.TryGetPropertyValue("UnTypedFriends", out obj); + + var friends = obj as IList; + + if(friends == null) + { + return ODataAPIResponseStatus.NotFound; + } + + foreach (var friend in friends) + { + object id1; + friend.TryGetPropertyValue("Id", out id1); + + if (id == id1.ToString()) + { + originalObject = friend; + break; + } + } + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override EdmODataAPIHandler GetNestedHandler(IEdmStructuredObject parent, string navigationPropertyName) + { + return null; + } + + } +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastContext.cs index 208156d060..559681f835 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastControllers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastControllers.cs index 31dbb0f8ee..3f137be628 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastControllers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastDataModel.cs index 1809de0cd6..3a359aa2b1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastEdmModel.cs index 6e7cd729e1..ae2f731a00 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastTest.cs index 1f260e3c3b..b5d54c9c60 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Cast/CastTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/AssertExtension.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/AssertExtension.cs index 90ad05e3f8..350c2218fa 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/AssertExtension.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/AssertExtension.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/AttackStringBuilder.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/AttackStringBuilder.cs index d809409ba6..c0b0643d60 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/AttackStringBuilder.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/AttackStringBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Text; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ComparisonHelper.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ComparisonHelper.cs index ae991080db..3b74e6e68e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ComparisonHelper.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ComparisonHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -258,4 +262,4 @@ private static object[] ToObjectArray(IEnumerable enumerable) return result.ToArray(); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Container.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Container.cs index d642d232d8..9bcf5c79f2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Container.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Container.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/AsyncInMemoryODataController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/AsyncInMemoryODataController.cs index aa16c66a93..b0260dbe9c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/AsyncInMemoryODataController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/AsyncInMemoryODataController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Concurrent; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/CollectionController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/CollectionController.cs index 22f6b8cac9..0b19449d4f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/CollectionController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/CollectionController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -98,4 +102,4 @@ public Dictionary EchoListOfObject(Dictionary input) } #endregion } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ComplexTypesCollectionsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ComplexTypesCollectionsController.cs index 235f8565f7..7f59feac60 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ComplexTypesCollectionsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ComplexTypesCollectionsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; @@ -861,4 +865,4 @@ public Dictionary EchoDictionaryOfstringAndBranch(Dictionary +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using Microsoft.Test.E2E.AspNet.OData.Common.Controllers.TypeLibrary; @@ -242,4 +246,4 @@ public Branch EchoBranch(Branch branch) return branch; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/JTokenController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/JTokenController.cs index 5ef131a8fc..d8332a2eea 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/JTokenController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/JTokenController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using Newtonsoft.Json.Linq; @@ -50,4 +54,4 @@ public JContainer EchoJContainer(JContainer input) return input; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ModelBindingBasedComplexTypesController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ModelBindingBasedComplexTypesController.cs index 9e99a15d7e..aead663200 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ModelBindingBasedComplexTypesController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ModelBindingBasedComplexTypesController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Web.Http; @@ -787,4 +791,4 @@ public Branch EchoBranch([FromUri] Branch input) return input; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ModelStateErrorHandlingAttribute.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ModelStateErrorHandlingAttribute.cs index 102dbc0597..31659fa6fd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ModelStateErrorHandlingAttribute.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/ModelStateErrorHandlingAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using Microsoft.AspNetCore.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/NorthwindController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/NorthwindController.cs index a9b643c985..ab196c0aba 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/NorthwindController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/NorthwindController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using Microsoft.Test.E2E.AspNet.OData.Common.Controllers.TypeLibrary; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/PrimitiveCollectionsOperationsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/PrimitiveCollectionsOperationsController.cs index 211487218f..59f2797338 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/PrimitiveCollectionsOperationsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/PrimitiveCollectionsOperationsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -681,4 +685,4 @@ public List ReverseListOfDBNullFromBody(List input) } #endregion } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/PrimitiveOperationsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/PrimitiveOperationsController.cs index ea1b4ebdde..8f1d30a9a4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/PrimitiveOperationsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/PrimitiveOperationsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TestControllers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TestControllers.cs index 875d51e068..708a46a58a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TestControllers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TestControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/ComplexTypes.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/ComplexTypes.cs index 32d811f1b0..34968f39c0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/ComplexTypes.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/ComplexTypes.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/ModelBindingBasedComplexTypes.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/ModelBindingBasedComplexTypes.cs index e46a754970..a4302043ec 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/ModelBindingBasedComplexTypes.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/ModelBindingBasedComplexTypes.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Globalization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/NorthwindTypes.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/NorthwindTypes.cs index dad6aa68d4..4af20747da 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/NorthwindTypes.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Controllers/TypeLibrary/NorthwindTypes.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated from a template. // diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/DataServiceContextAsyncExtension.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/DataServiceContextAsyncExtension.cs index caebbd9462..f86de990fb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/DataServiceContextAsyncExtension.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/DataServiceContextAsyncExtension.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/DataServiceQueryExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/DataServiceQueryExtensions.cs index c94559094c..26032c3306 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/DataServiceQueryExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/DataServiceQueryExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/PortArranger.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/PortArranger.cs index b0989a039e..efa8fc9aea 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/PortArranger.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/PortArranger.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -41,4 +45,4 @@ private static bool IsFree(int port) return !isInUse; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/SecurityHelper.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/SecurityHelper.cs index 09c7c50174..5ceb4157a8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/SecurityHelper.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/SecurityHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostLogExceptionFilter.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostLogExceptionFilter.cs index 0af6ffd0d6..8bc22d74a3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostLogExceptionFilter.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostLogExceptionFilter.cs @@ -1,6 +1,9 @@ - -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBase.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBase.cs index 18226d8780..f9f8a59ab2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBase.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; @@ -39,10 +43,10 @@ protected WebHostTestBase(WebHostTestFixture fixture) /// /// protected abstract void UpdateConfiguration(WebRouteConfiguration configuration); - + public void Dispose() { - if(Client != null) + if (Client != null) { Client.Dispose(); } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixture.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixture.cs index 0028d515f6..5179c741d2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixture.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebHostTestFixture.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; @@ -60,7 +64,7 @@ namespace Microsoft.Test.E2E.AspNet.OData.Common.Execution public class WebHostTestFixture : IDisposable { private static readonly string NormalBaseAddressTemplate = "http://{0}:{1}"; - + private int _port; private bool disposedValue = false; private Object thisLock = new Object(); @@ -152,7 +156,7 @@ public bool Initialize(Action testConfigurationAction) .Build(); _selfHostServer.Start(); -#else +#else _selfHostServer = WebApp.Start(this.BaseAddress, DefaultKatanaConfigure); #endif } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebRouteConfiguration.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebRouteConfiguration.cs index 0de3dfd4a9..c15225f3e7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebRouteConfiguration.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Execution/WebRouteConfiguration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpClientExtension.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpClientExtension.cs index 23e1e41a65..e32a219f13 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpClientExtension.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpClientExtension.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.CodeAnalysis; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpConfigurationExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpConfigurationExtensions.cs index 0d6754297a..1ec70c6220 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpConfigurationExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpConfigurationExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETFX // This class is only used in the AspNet version. using System.Web.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpContentExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpContentExtensions.cs index 8c3d704ad2..07ae6cb0d7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpContentExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpContentExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpRequestExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpRequestExtensions.cs index e361bcdc00..5a153a2289 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpRequestExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/HttpRequestExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/ODataPathHandlerExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/ODataPathHandlerExtensions.cs index fe1c8e7e08..1bb4432d14 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/ODataPathHandlerExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/ODataPathHandlerExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/ResourceContextExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/ResourceContextExtensions.cs index d8576edb86..9271d71775 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/ResourceContextExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Extensions/ResourceContextExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/FormatterFactory.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/FormatterFactory.cs index 503d447e85..575e3a97a5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/FormatterFactory.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/FormatterFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Buffers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/HttpClientExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/HttpClientExtensions.cs index d253e31374..81e57b204f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/HttpClientExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/HttpClientExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/HttpControllerContextExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/HttpControllerContextExtensions.cs index fe66a4a803..f2d8498f3d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/HttpControllerContextExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/HttpControllerContextExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.Contracts; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CharsToUseBuilder.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CharsToUseBuilder.cs index 85c0f13516..16f4f0f5cf 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CharsToUseBuilder.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CharsToUseBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/ComplexTypeInstanceCreator.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/ComplexTypeInstanceCreator.cs index 2a51c37bab..e97c709af2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/ComplexTypeInstanceCreator.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/ComplexTypeInstanceCreator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -96,4 +100,4 @@ private static void SetPublicFields(Type type, object obj, Random rndGen, Creato #endregion } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CookieHeaderValueInstanceCreator.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CookieHeaderValueInstanceCreator.cs index 8b843548a1..3ba9107a5b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CookieHeaderValueInstanceCreator.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CookieHeaderValueInstanceCreator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETFX // This class is only used in the AspNet version. using System; @@ -112,4 +116,4 @@ private static NameValueCollection CreateRandomNameValueCollection(Random rndGen } } } -#endif \ No newline at end of file +#endif diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CreatorSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CreatorSettings.cs index f1fb050dc1..3d43767b5b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CreatorSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/CreatorSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.Common.Instancing { @@ -148,4 +152,4 @@ internal void LeaveRecursion() currentDepth--; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/InstanceCreator.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/InstanceCreator.cs index 5f877b6375..6ec02d8ca6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/InstanceCreator.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/InstanceCreator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -265,4 +269,4 @@ private static bool HasInterface(Type type, Type interfaceType) #endregion } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/InstanceCreatorSurrogate.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/InstanceCreatorSurrogate.cs index c39498f96c..522ad634be 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/InstanceCreatorSurrogate.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/InstanceCreatorSurrogate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -28,4 +32,4 @@ public abstract class InstanceCreatorSurrogate /// of the type directly. This will cause a stack overflow. public abstract object CreateInstanceOf(Type type, Random rndGen, CreatorSettings creatorSettings); } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/JTokenInstanceCreator.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/JTokenInstanceCreator.cs index c6eeb7fb58..7557ad8a1b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/JTokenInstanceCreator.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/JTokenInstanceCreator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/PrimitiveCreator.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/PrimitiveCreator.cs index 13f87f267d..9577d966e5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/PrimitiveCreator.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/PrimitiveCreator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -762,4 +766,4 @@ private static void CreateUserInfo(StringBuilder sb, Random rndGen) #endregion } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/RandomSeedGenerator.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/RandomSeedGenerator.cs index fcdad2b874..2220c83bbd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/RandomSeedGenerator.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/RandomSeedGenerator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Globalization; @@ -48,4 +52,4 @@ public static int GetRandomSeed() #endregion } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/SyntaxCreator.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/SyntaxCreator.cs index c72e794abd..a8c659981f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/SyntaxCreator.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/SyntaxCreator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Text; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/ULongJsonNetRangeLimitSurrogate.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/ULongJsonNetRangeLimitSurrogate.cs index 505126b6e9..cf2a7483e1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/ULongJsonNetRangeLimitSurrogate.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Instancing/ULongJsonNetRangeLimitSurrogate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/JObjectExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/JObjectExtensions.cs index 00c7aae9b6..d89630859f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/JObjectExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/JObjectExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/JsonAssert.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/JsonAssert.cs index 699d1485f6..c1582a624b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/JsonAssert.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/JsonAssert.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/LinkRoutingConvention2.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/LinkRoutingConvention2.cs index 1056f0fbf1..ba14ad111c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/LinkRoutingConvention2.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/LinkRoutingConvention2.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ModelHelper.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ModelHelper.cs index 0ae95e8660..7ec5e9fec3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ModelHelper.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ModelHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Movie/Movie.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Movie/Movie.cs index 815356d4bf..b357de48b2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Movie/Movie.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Movie/Movie.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/BaseEntity.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/BaseEntity.cs index 283d7cde97..d5d9c03939 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/BaseEntity.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/BaseEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Configuration/ISettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Configuration/ISettings.cs index e51cd2813f..8321823e63 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Configuration/ISettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Configuration/ISettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Configuration { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Affiliates/Affiliate.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Affiliates/Affiliate.cs index e060ed98a2..3048c0619f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Affiliates/Affiliate.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Affiliates/Affiliate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Common; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogComment.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogComment.cs index 4864954ec7..637c9caf43 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogComment.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogComment.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Customers; @@ -25,4 +29,4 @@ public partial class BlogComment : CustomerContent /// public virtual BlogPost BlogPost { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogExtensions.cs index 26cc768880..fa703aeb51 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogPost.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogPost.cs index 452beeeb1e..cb69d29d20 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogPost.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogPost.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -83,4 +87,4 @@ public virtual ICollection BlogComments /// public virtual Language Language { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogPostTag.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogPostTag.cs index 8e5574300d..97ef7c9fde 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogPostTag.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogPostTag.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Blogs { @@ -18,4 +22,4 @@ public partial class BlogPostTag /// public virtual int BlogPostCount { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogSettings.cs index 570dd2f0f0..e41da89f15 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Blogs/BlogSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -37,4 +41,4 @@ public class BlogSettings : ISettings /// public bool ShowHeaderRssUrl { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/AttributeControlType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/AttributeControlType.cs index b8640c63b1..23dc1e7b5e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/AttributeControlType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/AttributeControlType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { @@ -37,4 +41,4 @@ public enum AttributeControlType /// FileUpload = 30, } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/BackInStockSubscription.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/BackInStockSubscription.cs index 228a466566..258586923e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/BackInStockSubscription.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/BackInStockSubscription.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/BackorderMode.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/BackorderMode.cs index 3eaa573a4b..635eebc244 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/BackorderMode.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/BackorderMode.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CatalogSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CatalogSettings.cs index 5e73638293..5fa8f4cf21 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CatalogSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CatalogSettings.cs @@ -1,6 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Configuration; @@ -263,4 +266,4 @@ public CatalogSettings() /// public int ManufacturersBlockItemsToDisplay { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Category.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Category.cs index 2add05a447..aab55cd4a5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Category.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Category.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CategoryTemplate.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CategoryTemplate.cs index a4bca61263..a118cfc81c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CategoryTemplate.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CategoryTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CrossSellProduct.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CrossSellProduct.cs index d02241bc29..6f55af210c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CrossSellProduct.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/CrossSellProduct.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/DownloadActivationType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/DownloadActivationType.cs index d7a452b133..4ef2003848 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/DownloadActivationType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/DownloadActivationType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/GiftCardType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/GiftCardType.cs index 0bb2c66f60..239c772809 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/GiftCardType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/GiftCardType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/LowStockActivity.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/LowStockActivity.cs index a47c19c977..0dad317156 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/LowStockActivity.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/LowStockActivity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ManageInventoryMethod.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ManageInventoryMethod.cs index 94c36f1ab8..4a03a680b5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ManageInventoryMethod.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ManageInventoryMethod.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Manufacturer.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Manufacturer.cs index 34cab9d585..be257a9fb8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Manufacturer.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Manufacturer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ManufacturerTemplate.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ManufacturerTemplate.cs index 073be44727..a716f2c7d1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ManufacturerTemplate.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ManufacturerTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/PriceRange.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/PriceRange.cs index 1e00284526..61bb8067d0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/PriceRange.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/PriceRange.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Product.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Product.cs index 997dffe661..3fa3b66b87 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Product.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/Product.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -174,4 +178,4 @@ public virtual ICollection ProductTags } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductAttribute.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductAttribute.cs index 5befac29d2..577f8aca0e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductAttribute.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductCategory.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductCategory.cs index 510eff68c2..207203bb6a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductCategory.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductCategory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductManufacturer.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductManufacturer.cs index 9d995fa331..8249b25a83 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductManufacturer.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductManufacturer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductPicture.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductPicture.cs index e620bec0c5..c8367d9bf0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductPicture.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductPicture.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Media; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductReview.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductReview.cs index 065c224ad8..96c211a70c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductReview.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductReview.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductReviewHelpfulness.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductReviewHelpfulness.cs index 5270d585b8..99f3036840 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductReviewHelpfulness.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductReviewHelpfulness.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductSortingEnum.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductSortingEnum.cs index 1ab180e497..786b872e8e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductSortingEnum.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductSortingEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { @@ -33,4 +37,4 @@ public enum ProductSortingEnum /// CreatedOn = 15, } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductSpecificationAttribute.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductSpecificationAttribute.cs index 26255f22c3..976caf2a32 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductSpecificationAttribute.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductSpecificationAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductTag.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductTag.cs index 52629be5b3..3e88b15aae 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductTag.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductTag.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductTemplate.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductTemplate.cs index 3a3f45cc16..f1203633e4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductTemplate.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariant.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariant.cs index dc8ffe09cb..9778005386 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariant.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariant.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttribute.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttribute.cs index 5bbbd23486..de784e1e42 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttribute.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttributeCombination.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttributeCombination.cs index 1e322e0701..cf12faa019 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttributeCombination.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttributeCombination.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttributeValue.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttributeValue.cs index 11487ca069..d74074670b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttributeValue.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantAttributeValue.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantExtensions.cs index ffce6bf52f..e281224ea3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/ProductVariantExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/RecurringProductCyclePeriod.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/RecurringProductCyclePeriod.cs index b727877a6f..9276fa1e00 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/RecurringProductCyclePeriod.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/RecurringProductCyclePeriod.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/RelatedProduct.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/RelatedProduct.cs index 5dc0a10bbc..c98181abc3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/RelatedProduct.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/RelatedProduct.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttribute.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttribute.cs index 69a9760a5c..0bb9dc14ef 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttribute.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttributeOption.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttributeOption.cs index 491c1fd41d..47614b4358 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttributeOption.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttributeOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttributeOptionFilter.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttributeOptionFilter.cs index 17d26923db..d0768c56a3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttributeOptionFilter.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/SpecificationAttributeOptionFilter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Catalog { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/TierPrice.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/TierPrice.cs index 3584e1a0ce..cccbc21087 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/TierPrice.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Catalog/TierPrice.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Cms/WidgetSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Cms/WidgetSettings.cs index db058aa041..333f6525b3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Cms/WidgetSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Cms/WidgetSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Configuration; @@ -18,4 +22,4 @@ public WidgetSettings() /// public List ActiveWidgetSystemNames { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/Address.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/Address.cs index aeda43a35c..244dfdf60a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/Address.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/Address.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Directory; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/AdminAreaSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/AdminAreaSettings.cs index a79741ddf4..5667e99f5e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/AdminAreaSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/AdminAreaSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -11,4 +15,4 @@ public class AdminAreaSettings : ISettings public bool DisplayProductPictures { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/CommonSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/CommonSettings.cs index ab5f2586a4..6bbc2281f0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/CommonSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/CommonSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -34,4 +38,4 @@ public class CommonSettings : ISettings /// public FulltextSearchMode FullTextMode { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/FulltextSearchMode.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/FulltextSearchMode.cs index 8c2c82bcbf..291c68f291 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/FulltextSearchMode.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/FulltextSearchMode.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Common { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/GenericAttribute.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/GenericAttribute.cs index 8ddd778d22..070d49b16a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/GenericAttribute.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/GenericAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Common { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/PdfSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/PdfSettings.cs index d8e43f6888..428b7cd8a3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/PdfSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Common/PdfSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -32,4 +36,4 @@ public class PdfSettings : ISettings /// public string FontFileName { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Configuration/Setting.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Configuration/Setting.cs index b0c0b2f36a..1159d506cf 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Configuration/Setting.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Configuration/Setting.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Configuration { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/BestCustomerReportLine.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/BestCustomerReportLine.cs index 0d16646d5a..04014de307 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/BestCustomerReportLine.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/BestCustomerReportLine.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Customers { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/Customer.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/Customer.cs index 6b0089d949..19a63f36ea 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/Customer.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/Customer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -485,4 +489,4 @@ public virtual void RemoveGiftCardCouponCode(string couponCode) #endregion } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerContent.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerContent.cs index 6bd6974e7b..0a7094ee53 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerContent.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerContent.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerNameFormat.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerNameFormat.cs index 046c79be9a..2878b8d3ff 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerNameFormat.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerNameFormat.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Customers { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerRole.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerRole.cs index 7a21e01787..087e42686a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerRole.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerRole.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Security; @@ -54,4 +58,4 @@ public virtual ICollection PermissionRecords } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerSettings.cs index b1d0e3b3a6..534ae49d23 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/CustomerSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -204,4 +208,4 @@ public class CustomerSettings : ISettings #endregion } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/ExternalAuthenticationRecord.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/ExternalAuthenticationRecord.cs index 173da88412..7809ff43e6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/ExternalAuthenticationRecord.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/ExternalAuthenticationRecord.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Customers { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/ExternalAuthenticationSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/ExternalAuthenticationSettings.cs index 54301da3d7..0ea194e2f4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/ExternalAuthenticationSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/ExternalAuthenticationSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Configuration; @@ -19,4 +23,4 @@ public ExternalAuthenticationSettings() /// public List ActiveAuthenticationMethodSystemNames { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/PasswordFormat.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/PasswordFormat.cs index eff8811e27..6b4ac51fc6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/PasswordFormat.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/PasswordFormat.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Customers { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/RewardPointsHistory.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/RewardPointsHistory.cs index 303f20d15c..949a2cfad8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/RewardPointsHistory.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/RewardPointsHistory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Orders; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/RewardPointsSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/RewardPointsSettings.cs index 2dfbd96738..2f3ca9b2d7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/RewardPointsSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/RewardPointsSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; using Nop.Core.Domain.Orders; @@ -43,4 +47,4 @@ public class RewardPointsSettings : ISettings /// public OrderStatus PointsForPurchases_Canceled { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerAttributeNames.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerAttributeNames.cs index ed748dcabd..489583f252 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerAttributeNames.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerAttributeNames.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Customers { @@ -62,4 +66,4 @@ public static partial class SystemCustomerAttributeNames /// public static string DontUseMobileVersion { get { return "DontUseMobileVersion"; } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerNames.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerNames.cs index fc506182ef..bf3bb91265 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerNames.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerNames.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Customers { @@ -7,4 +11,4 @@ public static partial class SystemCustomerNames { public static string SearchEngine { get { return "SearchEngine"; } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerRoleNames.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerRoleNames.cs index 8b9f4ff50c..66b2c7036e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerRoleNames.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/SystemCustomerRoleNames.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Customers { @@ -13,4 +17,4 @@ public static partial class SystemCustomerRoleNames public static string Guests { get { return "Guests"; } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/UserRegistrationType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/UserRegistrationType.cs index 92a61b2230..6555cce661 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/UserRegistrationType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Customers/UserRegistrationType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Customers { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/CountryOrRegion.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/CountryOrRegion.cs index e6f9d6ddf5..3b47c9b4d0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/CountryOrRegion.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/CountryOrRegion.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/Currency.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/Currency.cs index ea884bb5ed..045f1f6dec 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/Currency.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/Currency.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/CurrencySettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/CurrencySettings.cs index 39e6bdceff..4d83310ba7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/CurrencySettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/CurrencySettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -13,4 +17,4 @@ public class CurrencySettings : ISettings public bool AutoUpdateEnabled { get; set; } public long LastUpdateTime { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/ExchangeRate.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/ExchangeRate.cs index e64f8785a7..23c51b0f84 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/ExchangeRate.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/ExchangeRate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureDimension.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureDimension.cs index 97ea21dd2f..8e8475ea57 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureDimension.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureDimension.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Directory { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureSettings.cs index 8a61f45147..882611b0ce 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -10,4 +14,4 @@ public class MeasureSettings : ISettings public int BaseDimensionId { get; set; } public int BaseWeightId { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureWeight.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureWeight.cs index d3500ee22f..ce74ac80bd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureWeight.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/MeasureWeight.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Directory { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/StateProvince.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/StateProvince.cs index b3f79c23de..50f5e9b362 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/StateProvince.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Directory/StateProvince.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/Discount.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/Discount.cs index fa30218925..c5dcc60312 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/Discount.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/Discount.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountLimitationType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountLimitationType.cs index 17f0db1b82..1a01cfc859 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountLimitationType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountLimitationType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Discounts { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountRequirement.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountRequirement.cs index e138a8d98f..abde89e151 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountRequirement.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountRequirement.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Discounts { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountType.cs index 69f85fa5cc..644e2cc84e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Discounts { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountUsageHistory.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountUsageHistory.cs index d9c1991e0d..49c1b6e618 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountUsageHistory.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Discounts/DiscountUsageHistory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Orders; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/EditorType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/EditorType.cs index 292eb3c9ef..92969c388b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/EditorType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/EditorType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Forums { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/Forum.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/Forum.cs index fa60d964cc..a26510a43e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/Forum.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/Forum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumGroup.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumGroup.cs index c627128aad..db91a7fe99 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumGroup.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumGroup.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumPost.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumPost.cs index c0c4d2a0b4..ddc2a7b08a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumPost.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumPost.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSearchType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSearchType.cs index 00436158a2..8a687d5027 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSearchType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSearchType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Forums { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSettings.cs index 95b512a90f..06111470c0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSubscription.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSubscription.cs index cfbf2065a9..b4cdc0d218 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSubscription.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumSubscription.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumTopic.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumTopic.cs index 2fad9b8894..7e57b7ac57 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumTopic.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumTopic.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumTopicType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumTopicType.cs index 0340af5ba8..af11f4bda7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumTopicType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/ForumTopicType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Forums { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/PrivateMessage.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/PrivateMessage.cs index 8c2dcc9ee8..39f01935c8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/PrivateMessage.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Forums/PrivateMessage.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/ILocalizedEntity.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/ILocalizedEntity.cs index 6b34172611..d2e33de7f4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/ILocalizedEntity.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/ILocalizedEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Localization { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/ILocalizedEnum.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/ILocalizedEnum.cs index 1d6af5bd2d..6655bb19e7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/ILocalizedEnum.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/ILocalizedEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Localization { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/Language.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/Language.cs index 939b52adcb..d28f63f3b7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/Language.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/Language.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocaleStringResource.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocaleStringResource.cs index ad2f219e3f..b85756dbb6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocaleStringResource.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocaleStringResource.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Localization { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocalizationSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocalizationSettings.cs index d204c0aca0..70b88e5d4d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocalizationSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocalizationSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -27,4 +31,4 @@ public class LocalizationSettings : ISettings /// public bool LoadAllLocaleRecordsOnStartup { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocalizedProperty.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocalizedProperty.cs index e33a5fd7db..b3838b5433 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocalizedProperty.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Localization/LocalizedProperty.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Localization { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/ActivityLog.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/ActivityLog.cs index 47d66aa320..5d2a838cf2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/ActivityLog.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/ActivityLog.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/ActivityLogType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/ActivityLogType.cs index 47324c6767..2dfc9daf27 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/ActivityLogType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/ActivityLogType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Logging { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/Log.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/Log.cs index f02e4e2a63..4af3d99e73 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/Log.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/Log.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/LogLevel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/LogLevel.cs index fa939cd318..9938e51529 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/LogLevel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Logging/LogLevel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Logging { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/Download.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/Download.cs index 3c998e1f82..3041da273a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/Download.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/Download.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/MediaSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/MediaSettings.cs index 6ba66f70be..0f84a28114 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/MediaSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/MediaSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -27,4 +31,4 @@ public class MediaSettings : ISettings /// public int DefaultImageQuality { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/Picture.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/Picture.cs index 7094f1794a..e9b03c72ba 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/Picture.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/Picture.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Catalog; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/PictureType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/PictureType.cs index 05c297482c..756e36070a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/PictureType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Media/PictureType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Media { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/Campaign.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/Campaign.cs index c483eda0ff..1433cce793 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/Campaign.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/Campaign.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/EmailAccount.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/EmailAccount.cs index db2e02c5fa..b5ab444d38 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/EmailAccount.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/EmailAccount.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/EmailAccountSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/EmailAccountSettings.cs index 46466cd10b..d98cbc6b4c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/EmailAccountSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/EmailAccountSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/Events.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/Events.cs index 771ad27c08..deb682eedc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/Events.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/Events.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; @@ -138,4 +142,4 @@ public IList Tokens } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/MessageTemplate.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/MessageTemplate.cs index 87af96113c..f6be0b165d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/MessageTemplate.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/MessageTemplate.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/MessageTemplatesSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/MessageTemplatesSettings.cs index a1e5c1f6d4..9af6d8d9ea 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/MessageTemplatesSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/MessageTemplatesSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/NewsLetterSubscription.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/NewsLetterSubscription.cs index 2c1c86ee11..497d70992e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/NewsLetterSubscription.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/NewsLetterSubscription.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/QueuedEmail.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/QueuedEmail.cs index 70b095a142..4314f408b0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/QueuedEmail.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Messages/QueuedEmail.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsComment.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsComment.cs index d037729a71..1722a55f34 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsComment.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsComment.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Customers; @@ -30,4 +34,4 @@ public partial class NewsComment : CustomerContent /// public virtual NewsItem NewsItem { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsItem.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsItem.cs index aa03e0d0db..af7966e5c9 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsItem.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -88,4 +92,4 @@ public virtual ICollection NewsComments /// public virtual Language Language { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsSettings.cs index 1dd92b452f..a7eda8d783 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/News/NewsSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -42,4 +46,4 @@ public class NewsSettings : ISettings /// public bool ShowHeaderRssUrl { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/BestsellersReportLine.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/BestsellersReportLine.cs index 0a22287fa5..13449688f7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/BestsellersReportLine.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/BestsellersReportLine.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/CheckoutAttribute.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/CheckoutAttribute.cs index 074353315e..8e1e982a75 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/CheckoutAttribute.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/CheckoutAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Catalog; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/CheckoutAttributeValue.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/CheckoutAttributeValue.cs index 0bf230c701..f4e39feba0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/CheckoutAttributeValue.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/CheckoutAttributeValue.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/Events.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/Events.cs index c1fc32f363..ca462eb10c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/Events.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/Events.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Orders { @@ -32,4 +36,4 @@ public Order Order get { return _order; } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/GiftCard.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/GiftCard.cs index dd0120e5ea..35ab7fbac1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/GiftCard.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/GiftCard.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/GiftCardUsageHistory.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/GiftCardUsageHistory.cs index 877ee22115..9878045b63 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/GiftCardUsageHistory.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/GiftCardUsageHistory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/Order.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/Order.cs index c4140c5924..b2c96c1da1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/Order.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/Order.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderAverageReportLine.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderAverageReportLine.cs index 9a4f9f25cb..c3be174e5e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderAverageReportLine.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderAverageReportLine.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Orders { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderAverageReportLineSummary.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderAverageReportLineSummary.cs index 1992b6a9f3..d2367be6d1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderAverageReportLineSummary.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderAverageReportLineSummary.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Orders { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderNote.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderNote.cs index 9c2d870a46..cf18ae0980 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderNote.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderNote.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderProductVariant.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderProductVariant.cs index a173198fb2..8106e3330a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderProductVariant.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderProductVariant.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderSettings.cs index a49fef86c2..a0ea01c848 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Configuration; @@ -79,4 +83,4 @@ public class OrderSettings : ISettings public int MinimumOrderPlacementInterval { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderStatus.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderStatus.cs index 98025b74be..d33b2d57ca 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderStatus.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/OrderStatus.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Orders { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/RecurringPayment.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/RecurringPayment.cs index 1930b31847..6aa172d868 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/RecurringPayment.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/RecurringPayment.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/RecurringPaymentHistory.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/RecurringPaymentHistory.cs index eabfbede80..70f6f0d555 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/RecurringPaymentHistory.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/RecurringPaymentHistory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ReturnRequest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ReturnRequest.cs index 5242b713a9..207661a701 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ReturnRequest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ReturnRequest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ReturnRequestStatus.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ReturnRequestStatus.cs index 29608a9efd..02f28ae110 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ReturnRequestStatus.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ReturnRequestStatus.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Orders { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartItem.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartItem.cs index c8a3e7d643..b7e5e92d9b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartItem.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Nop.Core.Domain.Catalog; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartSettings.cs index f755492a7a..18a51629a1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -93,4 +97,4 @@ public class ShoppingCartSettings : ISettings /// public bool RoundPricesDuringCalculation { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartType.cs index b932520cc2..e5825e6f5e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Orders/ShoppingCartType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Orders { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Payments/PaymentSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Payments/PaymentSettings.cs index b90449eedf..c05f8a60c6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Payments/PaymentSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Payments/PaymentSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Configuration; @@ -28,4 +32,4 @@ public PaymentSettings() /// public bool BypassPaymentMethodSelectionIfOnlyOne { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Payments/PaymentStatus.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Payments/PaymentStatus.cs index ec6d6f5869..e73eab1156 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Payments/PaymentStatus.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Payments/PaymentStatus.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Payments { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/Poll.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/Poll.cs index 4892f7fd63..91d98950db 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/Poll.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/Poll.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -73,4 +77,4 @@ public virtual ICollection PollAnswers /// public virtual Language Language { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/PollAnswer.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/PollAnswer.cs index 983869166f..c6bff3e9cc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/PollAnswer.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/PollAnswer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; @@ -46,4 +50,4 @@ public virtual ICollection PollVotingRecords protected set { _pollVotingRecords = value; } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/PollVotingRecord.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/PollVotingRecord.cs index 96ce1da023..91c9264b62 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/PollVotingRecord.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Polls/PollVotingRecord.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Customers; @@ -20,4 +24,4 @@ public partial class PollVotingRecord : CustomerContent /// public virtual PollAnswer PollAnswer { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/DefaultPermissionRecord.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/DefaultPermissionRecord.cs index bbfb448798..d221d8e407 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/DefaultPermissionRecord.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/DefaultPermissionRecord.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/PermissionRecord.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/PermissionRecord.cs index 8c28a9cad0..43c66b9eae 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/PermissionRecord.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/PermissionRecord.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Customers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/SecuritySettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/SecuritySettings.cs index 2bf1bbd560..b51dbfe154 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/SecuritySettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Security/SecuritySettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Configuration; @@ -28,4 +32,4 @@ public class SecuritySettings : ISettings /// public bool HideAdminMenuItemsBasedOnPermissions { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/ISlugSupported.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/ISlugSupported.cs index 955319356f..b6b5f483bd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/ISlugSupported.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/ISlugSupported.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Seo { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/PageTitleSeoAdjustment.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/PageTitleSeoAdjustment.cs index ad557d7635..c4f39b59d4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/PageTitleSeoAdjustment.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/PageTitleSeoAdjustment.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Seo { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/SeoSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/SeoSettings.cs index 1bb79d4fcb..ce1e3f0533 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/SeoSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/SeoSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Configuration; @@ -24,4 +28,4 @@ public class SeoSettings : ISettings /// public List ReservedUrlRecordSlugs { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/UrlRecord.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/UrlRecord.cs index e746fac255..9fd8ddcf56 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/UrlRecord.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Seo/UrlRecord.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Seo { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/Shipment.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/Shipment.cs index 4d033edfa5..e3391c6253 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/Shipment.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/Shipment.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -59,4 +63,4 @@ public virtual ICollection ShipmentOrderProductVari protected set { _shipmentOrderProductVariants = value; } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShipmentOrderProductVariant.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShipmentOrderProductVariant.cs index 5b320cbbfb..e5c5669326 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShipmentOrderProductVariant.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShipmentOrderProductVariant.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Shipping { @@ -28,4 +32,4 @@ public partial class ShipmentOrderProductVariant : BaseEntity /// public virtual Shipment Shipment { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingMethod.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingMethod.cs index 95f3a444c6..e21b217762 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingMethod.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingMethod.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Domain.Directory; @@ -38,4 +42,4 @@ public virtual ICollection RestrictedCountries protected set { _restrictedCountries = value; } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingOption.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingOption.cs index 4646f4fc24..88f9ecaa9b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingOption.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingOption.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingSettings.cs index 84ce1f6c57..f09d605068 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Nop.Core.Configuration; @@ -54,4 +58,4 @@ public ShippingSettings() /// public bool ReturnValidOptionsIfThereAreAny { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingStatus.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingStatus.cs index b3494392ff..54c15b02a2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingStatus.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Shipping/ShippingStatus.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Shipping { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/StoreInformationSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/StoreInformationSettings.cs index f66f621833..a33a2d8e08 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/StoreInformationSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/StoreInformationSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tasks/ScheduleTask.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tasks/ScheduleTask.cs index 0a2b6be255..4b088f30b0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tasks/ScheduleTask.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tasks/ScheduleTask.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxBasedOn.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxBasedOn.cs index f9ed943930..6f1db8fc73 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxBasedOn.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxBasedOn.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Tax { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxCategory.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxCategory.cs index 44bebb2f24..6add5c64dd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxCategory.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxCategory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Tax { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxDisplayType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxDisplayType.cs index 2001e97544..b09627ed6a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxDisplayType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxDisplayType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Tax { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxSettings.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxSettings.cs index 4616b07e6e..7615445ee1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxSettings.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/TaxSettings.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Configuration; @@ -112,4 +116,4 @@ public class TaxSettings : ISettings /// public bool EuVatEmailAdminWhenNewVatSubmitted { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/VatNumberStatus.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/VatNumberStatus.cs index ec2b94f986..0105d1929b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/VatNumberStatus.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Tax/VatNumberStatus.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Nop.Core.Domain.Tax { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Topics/Topic.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Topics/Topic.cs index 377cacb744..f3338d024f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Topics/Topic.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/Domain/Topics/Topic.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Nop.Core.Domain.Localization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/NopException.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/NopException.cs index 92f03233bf..b97540e0c1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/NopException.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/NopCommerce/NopException.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Runtime.Serialization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Address.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Address.cs index 7e08ea4a26..0df2ba9154 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Address.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Address.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations.Schema; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Product.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Product.cs index 23f24e187d..537010b3ad 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Product.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Product.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/ProductFamily.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/ProductFamily.cs index 95cf70ece1..43f02f59ac 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/ProductFamily.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/ProductFamily.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/ProductsContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/ProductsContext.cs index 15c1721f86..cbe276a183 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/ProductsContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/ProductsContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations.Schema; using System.Data.Entity; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Supplier.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Supplier.cs index f96167d351..7c0a6b1b6f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Supplier.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/ProductFamilies/Supplier.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Address.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Address.cs index 9642cd480a..2aefd19853 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Address.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Address.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.Common.Models.Products { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Category.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Category.cs index 653599b3f8..27ca807cf6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Category.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Category.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Customer.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Customer.cs index 416a5e30a3..20ac99d0f7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Customer.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Customer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.ObjectModel; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Order.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Order.cs index 93c22764b1..93b3a1ba8f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Order.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Order.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Product.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Product.cs index eac506c6d7..aba7f2da15 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Product.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Product.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Runtime.Serialization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Supplier.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Supplier.cs index f7ef9ff9ec..87b803a0dc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Supplier.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Products/Supplier.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Runtime.Serialization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Vehicle/Vehicle.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Vehicle/Vehicle.cs index 9f2a0381da..fdd10a1a4a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Vehicle/Vehicle.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/Models/Vehicle/Vehicle.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.OData.Client; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/NavigationRoutingConvention2.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/NavigationRoutingConvention2.cs index 6d32f5bcca..8ba4ebf451 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/NavigationRoutingConvention2.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/NavigationRoutingConvention2.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataAcceptHeaderTestSet.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataAcceptHeaderTestSet.cs index 393fb81e60..487d0302e2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataAcceptHeaderTestSet.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataAcceptHeaderTestSet.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataHelper.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataHelper.cs index e63c360d0d..47e26537f3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataHelper.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestConstants.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestConstants.cs index f6f71bd1e0..c9b83ebcee 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestConstants.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestConstants.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.Common { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestExtension.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestExtension.cs index 8f142946fc..0b195ba941 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestExtension.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataTestExtension.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataUrlAssert.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataUrlAssert.cs index 24e08e51aa..9fdaeb97c3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataUrlAssert.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ODataUrlAssert.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Newtonsoft.Json.Linq; using Xunit; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/PlaceholderTraceWriter.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/PlaceholderTraceWriter.cs index a37c21a912..85690e8d6c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/PlaceholderTraceWriter.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/PlaceholderTraceWriter.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE using System; @@ -17,4 +21,4 @@ public void Trace(HttpRequestMessage request, string category, TraceLevel level, } } } -#endif \ No newline at end of file +#endif diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/PropertyRoutingConvention.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/PropertyRoutingConvention.cs index 4daeacd390..e5c09b10d7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/PropertyRoutingConvention.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/PropertyRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ResourceContextHelper.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ResourceContextHelper.cs index e0b218576a..fb3e0ba964 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ResourceContextHelper.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/ResourceContextHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAssembly.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAssembly.cs index 0f5cd04c1d..57dcbf2db6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAssembly.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAssembly.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAssemblyResolver.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAssemblyResolver.cs index b9239ece07..9e7fdbff82 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAssemblyResolver.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAssemblyResolver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETFX // This class is only used in the AspNet version. using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAttributeRoutingConvention.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAttributeRoutingConvention.cs index 863ce8ad9f..7a84de47f0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAttributeRoutingConvention.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestAttributeRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestControllerContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestControllerContext.cs index a70a790582..363f6fc8e8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestControllerContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestControllerContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestDbContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestDbContext.cs index 4208b76d4b..c83649554f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestDbContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestDbContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using Microsoft.EntityFrameworkCore; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestEntitySetRoutingConvention.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestEntitySetRoutingConvention.cs index 6e06d159f3..176d04a106 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestEntitySetRoutingConvention.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TestEntitySetRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; @@ -43,4 +47,4 @@ public override string SelectAction(ODataPath odataPath, HttpControllerContext c } #endif } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TheoryDataSet.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TheoryDataSet.cs index c50bea7df4..9e6919ad72 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TheoryDataSet.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TheoryDataSet.cs @@ -1,4 +1,11 @@ -using System.Collections; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Collections; using System.Collections.Generic; namespace Microsoft.Test.E2E.AspNet.OData.Common diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypeCreator/DynamicAssemblyResolver.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypeCreator/DynamicAssemblyResolver.cs index 6ebb763d62..87914b4ccb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypeCreator/DynamicAssemblyResolver.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypeCreator/DynamicAssemblyResolver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETFX // This class is only used in the AspNet version. using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypeCreator/ODataModelTypeCreator.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypeCreator/ODataModelTypeCreator.cs index 1517b43e90..7f330bc945 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypeCreator/ODataModelTypeCreator.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypeCreator/ODataModelTypeCreator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypesInjectionAssembly.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypesInjectionAssembly.cs index 1399b275f5..27bcce8712 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypesInjectionAssembly.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Common/TypesInjectionAssembly.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritance.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritance.cs index 63455a0df8..cafc932c28 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritance.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritance.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34014 diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceControllers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceControllers.cs index 63a3391be7..78604ad542 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceControllers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceDataModels.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceDataModels.cs index c4c89c2a88..34197929dd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceDataModels.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceDataModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceEdmModels.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceEdmModels.cs index 6360700fa6..9c5c6ac014 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceEdmModels.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceEdmModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceSerializeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceSerializeTest.cs index 08bfa420c4..7a1c9cc8e2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceSerializeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceSerializeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceTests.cs index 4a88640e6c..5f3c88d82f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ComplexTypeInheritance/ComplexTypeInheritanceTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -298,7 +302,13 @@ public async Task PatchContainingEntity(string modelMode) 'Center':{'X':1,'Y':2}, 'HasBorder':true }, - 'OptionalShapes': [ ] + 'OptionalShapes': [ + { + '@odata.type':'#Microsoft.Test.E2E.AspNet.OData.ComplexTypeInheritance.Circle', + 'Radius':1, + 'Center':{'X':1,'Y':2}, + 'HasBorder':true + }] }"; StringContent stringContent = new StringContent(content: content, encoding: Encoding.UTF8, mediaType: "application/json"); request.Content = stringContent; @@ -320,7 +330,7 @@ public async Task PatchContainingEntity(string modelMode) String.Format("\nExpected that Radius: 2, but actually: {0},\n request uri: {1},\n response payload: {2}", radius, requestUri, contentOfString)); JArray windows = contentOfJObject["OptionalShapes"] as JArray; - Assert.True(0 == windows.Count, + Assert.True(1 == windows.Count, String.Format("\nExpected count: {0},\n actual: {1},\n request uri: {2},\n response payload: {3}", 1, windows.Count, requestUri, contentOfString)); } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentControllers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentControllers.cs index 2b88b09870..1311008c62 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentControllers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentDataModels.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentDataModels.cs index 04125c52e3..173b224657 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentDataModels.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentDataModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentDataSource.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentDataSource.cs index d18b6f71b1..8d9cb0b416 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentDataSource.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentDataSource.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentEdmModels.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentEdmModels.cs index 9b9c726fc4..da0bc1c00a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentEdmModels.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentEdmModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentProxy.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentProxy.cs index f7850cabb3..d441d47da3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentProxy.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentProxy.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34014 diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentTests.cs index 0135c0fdad..61d20501ce 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Containment/ContainmentTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayContext.cs index 38ed5195f1..673b1daa0c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Data.Entity; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayController.cs index 4c4edee889..3735ea7864 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayEdmModel.cs index d1ccc88f49..334523e0c5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayModel.cs index 35cd5783f5..bd14b065d0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs index be6527b1c8..838ed526ab 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayWithEfTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayWithEfTest.cs index 2aa4a029b2..6e2eb8762e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayWithEfTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateAndTimeOfDayWithEfTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateWithEfTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateWithEfTest.cs index ea3248b367..3cc0df0c67 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateWithEfTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateAndTimeOfDay/DateWithEfTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetController.cs index eb2f1d1256..f45ea4333d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetDataModel.cs index 646b4bd03b..304f0ceca3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetEdmModel.cs index 4351a32a85..0b3d059186 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetTest.cs index c245ad2050..9486d73c97 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeOffsetSupport/DateTimeOffsetTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeController.cs index 554fe2c5f0..19b09ec98d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeDataModel.cs index c6f659d02c..9567ab3bcd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeDataModel.cs @@ -1,4 +1,11 @@ -using System; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; using System.Collections.Generic; namespace Microsoft.Test.E2E.AspNet.OData.DateTimeSupport diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeEdmModel.cs index d509453df6..fc21272829 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeTest.cs index 86b04fc421..039a44f3a2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DateTimeSupport/DateTimeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DeltaQueryTests/DeltaQueryTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DeltaQueryTests/DeltaQueryTests.cs index 744e7391f1..2a509e9b6c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DeltaQueryTests/DeltaQueryTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DeltaQueryTests/DeltaQueryTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -47,6 +51,7 @@ public async Task DeltaVerifyReslt() { HttpRequestMessage get = new HttpRequestMessage(HttpMethod.Get, BaseAddress + "/odata/TestCustomers?$deltaToken=abc"); get.Headers.Add("Accept", "application/json;odata.metadata=minimal"); + get.Headers.Add("OData-Version", "4.01"); HttpResponseMessage response = await Client.SendAsync(get); Assert.True(response.IsSuccessStatusCode); dynamic results = await response.Content.ReadAsObject(); @@ -55,7 +60,7 @@ public async Task DeltaVerifyReslt() var changeEntity = results.value[0]; Assert.True(((JToken)changeEntity).Count() == 7, "The changed customer should have 6 properties plus type written."); - string changeEntityType = changeEntity["@odata.type"].Value as string; + string changeEntityType = changeEntity["@type"].Value as string; Assert.True(changeEntityType != null, "The changed customer should have type written"); Assert.True(changeEntityType.Contains("#Microsoft.Test.E2E.AspNet.OData.TestCustomerWithAddress"), "The changed order should be a TestCustomerWithAddress"); Assert.True(changeEntity.Id.Value == 1, "The ID Of changed customer should be 1."); @@ -94,22 +99,22 @@ public async Task DeltaVerifyReslt() var newOrder = results.value[2]; Assert.True(((JToken)newOrder).Count() == 3, "The new order should have 2 properties plus context written"); - string newOrderContext = newOrder["@odata.context"].Value as string; + string newOrderContext = newOrder["@context"].Value as string; Assert.True(newOrderContext != null, "The new order should have a context written"); Assert.True(newOrderContext.Contains("$metadata#TestOrders"), "The new order should come from the TestOrders entity set"); Assert.True(newOrder.Id.Value == 27, "The ID of the new order should be 27"); Assert.True(newOrder.Amount.Value == 100, "The amount of the new order should be 100"); var deletedEntity = results.value[3]; - Assert.True(deletedEntity.id.Value == "7", "The ID of the deleted customer should be 7"); - Assert.True(deletedEntity.reason.Value == "changed", "The reason for the deleted customer should be 'changed'"); + Assert.True(deletedEntity["@id"].Value == "7", "The ID of the deleted customer should be 7"); + Assert.True(deletedEntity["@removed"].reason.Value == "changed", "The reason for the deleted customer should be 'changed'"); var deletedOrder = results.value[4]; - string deletedOrderContext = deletedOrder["@odata.context"].Value as string; + string deletedOrderContext = deletedOrder["@context"].Value as string; Assert.True(deletedOrderContext != null, "The deleted order should have a context written"); Assert.True(deletedOrderContext.Contains("$metadata#TestOrders"), "The deleted order should come from the TestOrders entity set"); - Assert.True(deletedOrder.id.Value == "12", "The ID of the deleted order should be 12"); - Assert.True(deletedOrder.reason.Value == "deleted", "The reason for the deleted order should be 'deleted'"); + Assert.True(deletedOrder["@id"].Value == "12", "The ID of the deleted order should be 12"); + Assert.True(deletedOrder["@removed"].reason.Value == "deleted", "The reason for the deleted order should be 'deleted'"); var deletedLink = results.value[5]; Assert.True(deletedLink.source.Value == "http://localhost/odata/DeltaCustomers(1)", "The source of the deleted link should be 'http://localhost/odata/DeltaCustomers(1)'"); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeCountQueryValidatorTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeCountQueryValidatorTest.cs index 41d796dc0f..1a07b4d33a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeCountQueryValidatorTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeCountQueryValidatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net; @@ -77,4 +81,4 @@ public override void Validate(CountQueryOption countQueryOption, ODataValidation } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeSerializerTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeSerializerTest.cs index 9cfc60878f..77ac9a1a60 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeSerializerTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/CustomizeSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -118,4 +122,4 @@ public override ODataResource CreateResource(SelectExpandNode selectExpandNode, return resource; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/DependencyInjectionController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/DependencyInjectionController.cs index 34545eaca7..39bd9a6529 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/DependencyInjectionController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/DependencyInjectionController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/DependencyInjectionEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/DependencyInjectionEdmModel.cs index f052ec1c63..4f121d60d6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/DependencyInjectionEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DependencyInjection/DependencyInjectionEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesControllers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesControllers.cs index a53fcbdc1f..92dd8495dc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesControllers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesDataModel.cs index 3929cd9fae..7a0acf53df 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesTests.cs index 5f7ac20ddd..3031c4abc2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DerivedTypes/DerivedTypesTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatController.cs index 681cbe2ac3..f3e954b520 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatModel.cs index 2db9acd725..01bc4eb74f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatOverrideAcceptMediaTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatOverrideAcceptMediaTypeTests.cs index 1d1d225450..dc40e3e5ab 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatOverrideAcceptMediaTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatOverrideAcceptMediaTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http; @@ -508,4 +512,4 @@ public async Task QueryMetadataDocumentWithDollarFormatOverrideAcceptMediaTypeTe XmlReader.Create(await response.Content.ReadAsStreamAsync()); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatWithoutAcceptMediaTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatWithoutAcceptMediaTypeTests.cs index 8df62a1598..7220f83265 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatWithoutAcceptMediaTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarFormat/DollarFormatWithoutAcceptMediaTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -398,4 +402,4 @@ public async Task QueryMetadataDocumentWithDollarFormatWithoutAcceptMediaTypeTes XmlReader.Create(await response.Content.ReadAsStreamAsync()); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdClientTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdClientTest.cs index 96c537f86a..5c4823c267 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdClientTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdClientTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdControllers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdControllers.cs index 505e636287..4dfaf0ae6c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdControllers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdModel.cs index 237841b2ff..206cc1bb02 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdTest.cs index d04d115edf..9a5726f3f7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/DollarIdTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/ODataClient.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/ODataClient.cs index 27f31885d0..87a1f6a71c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/ODataClient.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarId/ODataClient.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34014 diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsController.cs index 5c82bed89e..efbb31c121 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -140,7 +144,7 @@ public ITestActionResult Get(int key, ODataQueryOptions queryOptions return BadRequest(responseMessage); } - var employee = _DLEmployees.Single(e=>e.ID == key); + var employee = _DLEmployees.Single(e => e.ID == key); var appliedEmployee = queryOptions.ApplyTo(employee, new ODataQuerySettings()); return Ok(appliedEmployee, appliedEmployee.GetType()); } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsDataModel.cs index e5d640713e..86374db467 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsDataModel.cs @@ -1,7 +1,12 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; namespace Microsoft.Test.E2E.AspNet.OData.DollarLevels { @@ -22,4 +27,12 @@ public class DLEmployee public DLEmployee Friend { get; set; } } + + + public class TestQueryOptions + { + [Key] + public string Id { get; set; } + public string name { get; set; } + } } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsEdmModel.cs index 1e8c19eaa2..4c9a3bc0f3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; @@ -14,6 +18,7 @@ public static IEdmModel GetConventionModel(WebRouteConfiguration configuration) ODataConventionModelBuilder builder = configuration.CreateConventionModelBuilder(); builder.EntitySet("DLManagers"); builder.EntitySet("DLEmployees"); + builder.EntitySet("Tests"); builder.Namespace = typeof(DLManager).Namespace; return builder.GetEdmModel(); diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsTest.cs index f4648131fa..ef49d1c37c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarLevels/DollarLevelsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryCustomersController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryCustomersController.cs index d360304826..8688532e56 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryCustomersController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryCustomersController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryModels.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryModels.cs index e389c66075..5496040ae6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryModels.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryTests.cs index 056f1e413e..9b01eba1e2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/DollarQuery/DollarQueryTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DeleteUpdatedEntryWithIfMatchETagsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DeleteUpdatedEntryWithIfMatchETagsTest.cs index d93519f207..51ea92d536 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DeleteUpdatedEntryWithIfMatchETagsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DeleteUpdatedEntryWithIfMatchETagsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net; @@ -73,4 +77,4 @@ public async Task DeleteUpdatedEntryWithIfMatchShouldReturnPreconditionFailed() } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DerivedETagTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DerivedETagTests.cs index ae6344ddc3..8c52969bb1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DerivedETagTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DerivedETagTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DominiosController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DominiosController.cs index 9249540ea5..c7fbeba1f4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DominiosController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/DominiosController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContext.cs index fcc8496b89..83b8ede414 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContextTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContextTest.cs index a32c4cec3e..e878656db3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContextTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagCurrencyTokenEfContextTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Text.RegularExpressions; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsController.cs index 7f273fc24d..9689a26763 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsModel.cs index 80529b24dd..fe4584f68c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsOtherTypesTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsOtherTypesTest.cs index 16d803a42b..7bc7e9edc6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsOtherTypesTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsOtherTypesTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -151,4 +155,4 @@ private IDictionary ParseETag(EntityTagHeaderValue etagHeaderVal return properties; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsUntypedTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsUntypedTests.cs index 1d0cfd8d5f..3771b3aa57 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsUntypedTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/ETagsUntypedTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http; @@ -135,4 +139,4 @@ public ITestActionResult Get(int key) return Ok(customer); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/GetEntryWithIfNoneMatchETagsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/GetEntryWithIfNoneMatchETagsTest.cs index 72007bc8e0..d5c2f548b8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/GetEntryWithIfNoneMatchETagsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/GetEntryWithIfNoneMatchETagsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net; @@ -73,4 +77,4 @@ public async Task GetEntryWithIfNoneMatchShouldReturnNotModifiedETagsTest() } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/JsonETagsTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/JsonETagsTests.cs index f3e40a5202..17273c9672 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/JsonETagsTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/JsonETagsTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -194,4 +198,4 @@ public async Task JsonWithNoneMetadataLevelsNotIncludeETags() } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PatchUpdatedEntryWithIfMatchETagsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PatchUpdatedEntryWithIfMatchETagsTest.cs index e03671d972..74519b80d3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PatchUpdatedEntryWithIfMatchETagsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PatchUpdatedEntryWithIfMatchETagsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net; @@ -101,4 +105,4 @@ public async Task PatchUpdatedEntryWithIfMatchShouldReturnPreconditionFailed() Assert.Equal(HttpStatusCode.PreconditionFailed, response.StatusCode); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PutUpdatedEntryWithIfMatchETagsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PutUpdatedEntryWithIfMatchETagsTest.cs index 8d0f95bd43..93424f2ef9 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PutUpdatedEntryWithIfMatchETagsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ETags/PutUpdatedEntryWithIfMatchETagsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; @@ -74,4 +78,4 @@ public async Task PutUpdatedEntryWithIfMatchShouldReturnPreconditionFailed() Assert.Equal(HttpStatusCode.PreconditionFailed, response.StatusCode); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationController.cs index 11ad5930f4..d7cb02b75a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationDataModel.cs index 702862b2be..83923286ce 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationEdmModel.cs index 79612c6c24..3053615215 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationTests.cs index 48d7e39f38..2709faafab 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/EntitySetAggregation/EntitySetAggregationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsAliasTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsAliasTest.cs index 06bf181dd4..aa78bce6c1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsAliasTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsAliasTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http; @@ -107,4 +111,4 @@ public async Task QueryEntitiesFilterByEnumWithoutEnumAlias() } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsController.cs index 28f6edd88b..7b24677444 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsDataModel.cs index a408a850a9..dd27dff84a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsEdmModel.cs index 2f6b7e87cd..fb11afd990 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsTest.cs index b770c22caa..2b179077f1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Enums/EnumsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; @@ -693,4 +697,4 @@ private async Task ResetDatasource() return response; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyContext.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyContext.cs index 40891a2c93..b514136205 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyContext.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Data.Entity; using System.Data.Entity.ModelConfiguration.Conventions; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyEdmModel.cs index f647b50ec5..154b1505f3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyModel.cs index 18c3ca104d..cc9d65cf46 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyTest.cs index 5da7e98fb6..a54c5f08df 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignKeyTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignkeyController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignkeyController.cs index 4add3b512a..824df32fe8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignkeyController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ForeignKey/ForeignkeyController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/BaseAddressFactoryTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/BaseAddressFactoryTest.cs index 4d802a0e4d..e23c913384 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/BaseAddressFactoryTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/BaseAddressFactoryTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/CollectionPropertyTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/CollectionPropertyTests.cs index bf6fcf975d..a2c77ae718 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/CollectionPropertyTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/CollectionPropertyTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ComplexTypeTests.cs index f48799fec7..32335bb5b1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ComplexTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeltaTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeltaTests.cs index 9542d4aea8..3221c66fdf 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeltaTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeltaTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; @@ -41,6 +45,7 @@ using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNet.OData.Routing; using Microsoft.AspNet.OData.Routing.Conventions; +using Microsoft.AspNet.OData.Test.Builder.TestModels.Recursive; using Microsoft.OData.Client; using Microsoft.OData.Edm; using Microsoft.Test.E2E.AspNet.OData.Common; @@ -351,7 +356,8 @@ private static IEdmModel GetModel(WebRouteConfiguration config) } [Fact] - public async Task PutShouldntOverrideNavigationProperties() + //Changing the test from shouldnt to should as it override navigation properties with bulk operations + public async Task PutShouldOverrideNavigationProperties() { string putUri = BaseAddress + "/odata/DeltaCustomers(5)"; ExpandoObject data = new ExpandoObject(); @@ -362,12 +368,13 @@ public async Task PutShouldntOverrideNavigationProperties() response = await Client.SendAsync(get); Assert.True(response.IsSuccessStatusCode); dynamic query = await response.Content.ReadAsObject(); - Assert.Equal(3, query.Orders.Count); + Assert.Equal(0, query.Orders.Count); } } public class PatchtDeltaOfTTests : WebHostTestBase { + static IEdmModel model; public PatchtDeltaOfTTests(WebHostTestFixture fixture) :base(fixture) { @@ -385,15 +392,32 @@ private static IEdmModel GetModel(WebRouteConfiguration config) ODataModelBuilder builder = config.CreateConventionModelBuilder(); builder.EntitySet("DeltaCustomers"); builder.EntitySet("DeltaOrders"); - return builder.GetEdmModel(); + model = builder.GetEdmModel(); + return model; } + [Fact] public async Task PatchShouldSupportNonSettableCollectionProperties() { + + var changedEntity = new EdmDeltaEntityObject(model.FindDeclaredType("Microsoft.Test.E2E.AspNet.OData.Formatter.DeltaCustomer") as IEdmEntityType); + changedEntity.TrySetPropertyValue("Id", 1); + changedEntity.TrySetPropertyValue("FathersAge", 3); + HttpRequestMessage patch = new HttpRequestMessage(new HttpMethod("MERGE"), BaseAddress + "/odata/DeltaCustomers(6)"); - dynamic data = new ExpandoObject(); - data.Addresses = Enumerable.Range(10, 3).Select(i => new DeltaAddress { ZipCode = i }); + var data = new ExpandoObject() as IDictionary; + + foreach(var prop in changedEntity.GetChangedPropertyNames()) + { + object val; + if(changedEntity.TryGetPropertyValue(prop, out val)) + { + data.Add(prop, val); + } + + } + string content = JsonConvert.SerializeObject(data); patch.Content = new StringContent(content); patch.Content.Headers.ContentType = MediaTypeHeaderValue.Parse("application/json"); @@ -401,13 +425,14 @@ public async Task PatchShouldSupportNonSettableCollectionProperties() Assert.True(response.IsSuccessStatusCode); - HttpRequestMessage get = new HttpRequestMessage(HttpMethod.Get, BaseAddress + "/odata/DeltaCustomers(6)?$expand=Orders"); + HttpRequestMessage get = new HttpRequestMessage(HttpMethod.Get, BaseAddress + "/odata/DeltaCustomers(1)?$expand=Orders"); response = await Client.SendAsync(get); Assert.True(response.IsSuccessStatusCode); dynamic query = await response.Content.ReadAsObject(); - Assert.Equal(3, query.Addresses.Count); + Assert.Equal(2, query.Addresses.Count); Assert.Equal(3, query.Orders.Count); } + } public class DeltaCustomersController : TestODataController @@ -453,6 +478,7 @@ public ITestActionResult Put([FromODataUri] int key, [FromBody] Delta c.Id == key).FirstOrDefault(); entity.Put(customer); return Ok(customer); + } [AcceptVerbs("PATCH", "MERGE")] @@ -482,6 +508,7 @@ public DeltaCustomer(string name, IEnumerable addresses, IEnumerab _addresses = addresses.ToList(); Orders = orders.ToList(); } + public int Id { get; set; } private string _name = null; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeserializationAndSerializationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeserializationAndSerializationTests.cs index 8e256fef1b..798a60aaa8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeserializationAndSerializationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/DeserializationAndSerializationTests.cs @@ -1,6 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.Formatter { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ErrorMessagesTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ErrorMessagesTests.cs index ebd1ebf525..0a35b07d5a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ErrorMessagesTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ErrorMessagesTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SerializeEntityReferenceLinks.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SerializeEntityReferenceLinks.cs index 0c9be26cd9..84b583a9a0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SerializeEntityReferenceLinks.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SerializeEntityReferenceLinks.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; @@ -282,4 +286,4 @@ public object GetService(Type serviceType) } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SupportDollarValue.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SupportDollarValue.cs index 5c8f877e80..b2f6363351 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SupportDollarValue.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Extensibility/SupportDollarValue.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/HttpAndODataErrorTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/HttpAndODataErrorTests.cs index cc4c64343f..4483bf1fac 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/HttpAndODataErrorTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/HttpAndODataErrorTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these tests for AspNetCore using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/InheritanceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/InheritanceTests.cs index dd691eb008..9123c1dab2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/InheritanceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/InheritanceTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/HttpAndODataErrorTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/HttpAndODataErrorTests.cs index f964d6bbf5..e0954cec32 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/HttpAndODataErrorTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/HttpAndODataErrorTests.cs @@ -1,4 +1,11 @@ -using System; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; using System.Linq; using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightCollectionPropertyTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightCollectionPropertyTests.cs index 73bbfc7490..8d9f4c67f9 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightCollectionPropertyTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightCollectionPropertyTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightComplexTypeTests.cs index e5a55aa982..52f04f0ce5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightComplexTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightConfigurator.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightConfigurator.cs index 9a4bd9c36b..9d166ee9a1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightConfigurator.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightConfigurator.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeltaTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeltaTests.cs index e7949e4137..5bf9960557 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeltaTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeltaTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeserializationAndSerializationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeserializationAndSerializationTests.cs index 83126ebd5c..e3cc932272 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeserializationAndSerializationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightDeserializationAndSerializationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightInheritanceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightInheritanceTests.cs index 6bbd49e461..b629a03394 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightInheritanceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightInheritanceTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightMixScenarioTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightMixScenarioTests.cs index 22a9cf61bd..af88d44e56 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightMixScenarioTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightMixScenarioTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightRandomModelTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightRandomModelTests.cs index b432dcd60b..242314020d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightRandomModelTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/JsonLightRandomModelTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ActionMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ActionMetadataTests.cs index b57871e881..fd49d0c4a5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ActionMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ActionMetadataTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ComplexTypeTests.cs index aa0fa4cf1c..0693b8cdf7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/ComplexTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/BaseEntityController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/BaseEntityController.cs index 7550d75e41..408bb27155 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/BaseEntityController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/BaseEntityController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.Test.E2E.AspNet.OData.Common.Controllers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/EntityWithComplexPropertiesController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/EntityWithComplexPropertiesController.cs index 9e454f0d8c..7ca74a7ed5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/EntityWithComplexPropertiesController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/EntityWithComplexPropertiesController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.Test.E2E.AspNet.OData.Common.Controllers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/EntityWithSimplePropertiesController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/EntityWithSimplePropertiesController.cs index 7012585eef..da59869299 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/EntityWithSimplePropertiesController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/EntityWithSimplePropertiesController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/OneToOneChildController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/OneToOneChildController.cs index 618b94e53c..0eb8e690fa 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/OneToOneChildController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/OneToOneChildController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.Test.E2E.AspNet.OData.Common.Controllers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/OneToOneParentController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/OneToOneParentController.cs index fda1b3e14b..ae57a68f6b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/OneToOneParentController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/OneToOneParentController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/StubEntityController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/StubEntityController.cs index 38564027fd..3017587025 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/StubEntityController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Controllers/StubEntityController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/CustomConventionActionMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/CustomConventionActionMetadataTests.cs index 9caef30c7a..470b99ce92 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/CustomConventionActionMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/CustomConventionActionMetadataTests.cs @@ -1,4 +1,9 @@ -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/EntryMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/EntryMetadataTests.cs index bac45f1c17..2836e0081b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/EntryMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/EntryMetadataTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Extensions/HttpRequestMessageExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Extensions/HttpRequestMessageExtensions.cs index 2b741043e7..a9120a9e1c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Extensions/HttpRequestMessageExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Extensions/HttpRequestMessageExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Extensions/ReflectedPropertyRoutingConvention.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Extensions/ReflectedPropertyRoutingConvention.cs index 701f5168c9..79112b01ee 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Extensions/ReflectedPropertyRoutingConvention.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Extensions/ReflectedPropertyRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/FeedMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/FeedMetadataTests.cs index e7d586c114..1374aa7e94 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/FeedMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/FeedMetadataTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MetadataTestHelpers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MetadataTestHelpers.cs index 898cd27e2b..266c6aff99 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MetadataTestHelpers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MetadataTestHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MinimalMetadataSpecificTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MinimalMetadataSpecificTests.cs index 9a74344c05..459c11f24f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MinimalMetadataSpecificTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/MinimalMetadataSpecificTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/BaseEntity.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/BaseEntity.cs index 7ab351b3b5..eb6401c448 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/BaseEntity.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/BaseEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/ComplexType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/ComplexType.cs index 4b54764346..eb7f147210 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/ComplexType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/ComplexType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/DerivedEntity.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/DerivedEntity.cs index ed4920a19f..8e82748b4a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/DerivedEntity.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/DerivedEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata.Model { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/EntityWithComplexProperties.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/EntityWithComplexProperties.cs index f9b2ac67b6..c2f0bb26fc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/EntityWithComplexProperties.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/EntityWithComplexProperties.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/EntityWithSimpleProperties.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/EntityWithSimpleProperties.cs index b1253d166c..997a081d0e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/EntityWithSimpleProperties.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/EntityWithSimpleProperties.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/OneToOneChild.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/OneToOneChild.cs index a36a9a48f5..400397fbeb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/OneToOneChild.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/OneToOneChild.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata.Model { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/OneToOneParent.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/OneToOneParent.cs index cdbadee5cd..68d34f6484 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/OneToOneParent.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/OneToOneParent.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata.Model { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/SimpleEnumeration.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/SimpleEnumeration.cs index e2dad3fcf0..71a0a6dd5a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/SimpleEnumeration.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/SimpleEnumeration.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata.Model { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/StubEntity.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/StubEntity.cs index 6a406bafd2..82e34782ef 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/StubEntity.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/Model/StubEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.Formatter.JsonLight.Metadata.Model { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/PrimitiveTypesMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/PrimitiveTypesMetadataTests.cs index ccaf62de0e..f8efd78e43 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/PrimitiveTypesMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/JsonLight/Metadata/PrimitiveTypesMetadataTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/MixScenarioTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/MixScenarioTests.cs index 3b2314dcd8..bda4628630 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/MixScenarioTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/MixScenarioTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFeedSerializeWithoutNavigationSourceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFeedSerializeWithoutNavigationSourceTests.cs index 01534d62fb..c8bf430f1f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFeedSerializeWithoutNavigationSourceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFeedSerializeWithoutNavigationSourceTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFormatterTestBase.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFormatterTestBase.cs index c2d886895a..9eae186520 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFormatterTestBase.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataFormatterTestBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.OData.Client; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataResultTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataResultTests.cs index 6180463ec1..ffc5f4645d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataResultTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ODataResultTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/RandomModelTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/RandomModelTests.cs index e24a095954..93979bfa4c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/RandomModelTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/RandomModelTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SecurityTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SecurityTests.cs index 56c78f28b0..15679757f1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SecurityTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SecurityTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ServerDrivenPagingTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ServerDrivenPagingTests.cs index 8dd3727868..324d8967b5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ServerDrivenPagingTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/ServerDrivenPagingTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Threading.Tasks; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SupportMediaTypesTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SupportMediaTypesTests.cs index ebb8f97d12..7ee18c06e2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SupportMediaTypesTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/SupportMediaTypesTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedDeltaSerializationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedDeltaSerializationTests.cs index d500345999..db31d195af 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedDeltaSerializationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedDeltaSerializationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http; @@ -51,6 +55,7 @@ public async Task UntypedDeltaWorksInAllFormats(string acceptHeader) string url = "/untyped/UntypedDeltaCustomers?$deltatoken=abc"; HttpRequestMessage request = new HttpRequestMessage(HttpMethod.Get, BaseAddress + url); request.Headers.Accept.Add(MediaTypeWithQualityHeaderValue.Parse(acceptHeader)); + request.Headers.Add("OData-Version", "4.01"); HttpResponseMessage response = await Client.SendAsync(request); Assert.True(response.IsSuccessStatusCode); Assert.NotNull(response.Content); @@ -67,8 +72,7 @@ public async Task UntypedDeltaWorksInAllFormats(string acceptHeader) for (int i=10 ; i < 15 ; i++) { string contextUrl = BaseAddress.ToLowerInvariant() + "/untyped/$metadata#UntypedDeltaCustomers/$deletedEntity"; - Assert.True(contextUrl.Equals(((dynamic)returnedObject).value[i]["@odata.context"].Value)); - Assert.True(i.ToString().Equals(((dynamic)returnedObject).value[i]["id"].Value)); + Assert.True(i.ToString().Equals(((dynamic)returnedObject).value[i]["@id"].Value)); } } } diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedSerializationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedSerializationTests.cs index 24b1d69721..99837ec02c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedSerializationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Formatter/Untyped/UntypedSerializationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseController.cs index 3fb8bc18de..a61000ad73 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseDataModel.cs index 4d166b2f3b..d85162cb33 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Runtime.Serialization; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseEdmModel.cs index c9f2ae1427..408450b545 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseTest.cs index 076b156e73..e2904daea2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/LowerCamelCase/LowerCamelCaseTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -612,4 +616,4 @@ private bool IsCamelCase(string token) return !char.IsUpper(token[0]); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/FormattersTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/FormattersTests.cs index 66a4ae79f9..752915d844 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/FormattersTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/FormattersTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.ObjectModel; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/GeneratedConventionModelClient.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/GeneratedConventionModelClient.cs index 7ac0d4ca94..151e3f9c85 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/GeneratedConventionModelClient.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/GeneratedConventionModelClient.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34003 diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/MetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/MetadataTests.cs index ce1be629c9..d7923d7580 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/MetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/MetadataTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/Model.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/Model.cs index af14607074..998806bbeb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/Model.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/Model.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/QueryTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/QueryTests.cs index 5148216495..e5300f3ab4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/QueryTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelAliasing/QueryTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedController.cs index 1b735c6d30..d5028e72ad 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedEdmModel.cs index 11a27b9b8e..3ed54e8581 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Query; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedTest.cs index dbd92a7b0a..d752205942 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CombinedTest/CombinedTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; @@ -151,4 +155,4 @@ public async Task QuerySettingsOnPropertyPositive(string entitySetUrl, string ur Assert.Equal(HttpStatusCode.OK, response.StatusCode); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAtrributeController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAtrributeController.cs index 0f9fa045d5..2aa8d9fd7a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAtrributeController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAtrributeController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeEdmModel.cs index bf5c20add9..078df3e504 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Query; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeTest.cs index 9e35f4fc15..d81ffc8638 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/CountAttributeTest/CountAttributeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; @@ -120,4 +124,4 @@ public async Task CountOnProperty(string url, string error) Assert.Contains(error + " cannot be used for $count", result); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAtrributeController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAtrributeController.cs index 26260c62f2..f063213fc9 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAtrributeController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAtrributeController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeEdmModel.cs index 59f96d6624..7e5026f60f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Query; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeTest.cs index 36aa683e28..0e56fa7637 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/ExpandAttributeTest/ExpandAttributeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; @@ -189,4 +193,4 @@ public async Task AutomaticExpandInDerivedType(string url) Assert.Contains("SpecialOrder", result); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAtrributeController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAtrributeController.cs index 4852e2cae5..47c8cd9a80 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAtrributeController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAtrributeController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeEdmModel.cs index d3fdb29043..3d6d45dc6a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Query; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeTest.cs index ef83bc027f..a05b230205 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/FilterAttributeTest/FilterAttributeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; @@ -183,4 +187,4 @@ public async Task FilterSingleNavigationOrComplexProperty(string entitySetUrl, i } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAtrributeController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAtrributeController.cs index 488c1ca039..50f23ad28d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAtrributeController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAtrributeController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeEdmModel.cs index 1cd0c7c1e9..7e68562ac2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Query; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeTest.cs index f823b56b18..3f01a8c07e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/OrderByAttributeTest/OrderByAttributeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; @@ -183,4 +187,4 @@ public async Task OrderBySingleNavigationOrComplexProperty(string entitySetUrl, } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeController.cs index 0df84db5f2..f58a0af328 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeEdmModel.cs index 23ab7c2234..064c3450f7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Query; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeTest.cs index d377d3f145..268ecdf755 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/PageAttributeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; @@ -198,4 +202,4 @@ public async Task CompatibilityFlagRespectedForNextLink() Assert.Contains("$top=0&$skip=5", result); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenController.cs index 5e7505e9e4..0a79206ce8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenEdmModel.cs index e7a8320e38..af20bc8b6f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenTest.cs index f1bae966e0..97b398177b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/PageAttributeTest/SkipTokenTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net; @@ -287,4 +291,4 @@ public async Task GenerateEncodedSkipTokenOnEntityWithDateTimeOffset(string quer Assert.Contains(expected, result); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeController.cs index d9b1459e31..b500769534 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeEdmModel.cs index 0620b5d0fe..ef8677bda5 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Query; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeTest.cs index 777f01e696..06834b06da 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBoundQuerySettings/SelectAttributeTest/SelectAttributeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; @@ -289,4 +293,4 @@ public async Task AutomaticSelectInDerivedType(string url) Assert.DoesNotContain("Id", result); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ActionMetadataTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ActionMetadataTests.cs index 597a9fd154..808b9f930b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ActionMetadataTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ActionMetadataTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.IO; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/AttributeConventionModelBuilderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/AttributeConventionModelBuilderTests.cs index 6eb15b543e..a109d91c67 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/AttributeConventionModelBuilderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/AttributeConventionModelBuilderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel; using System.ComponentModel.DataAnnotations; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ConditionalLinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ConditionalLinkGenerationTests.cs index ef6447480f..4877e24c8b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ConditionalLinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ConditionalLinkGenerationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ExplicitModelBuilderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ExplicitModelBuilderTests.cs index 5e46071ec1..67b400244b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ExplicitModelBuilderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ExplicitModelBuilderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -249,4 +253,4 @@ public async Task VerifyMetaDataIsGeneratedCorrectly() Assert.Equal(7, vocabularyAnnotations.Count); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ImplicitModelBuilderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ImplicitModelBuilderTests.cs index 0f1a030c8d..50984cf5bb 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ImplicitModelBuilderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ImplicitModelBuilderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -243,4 +247,4 @@ public async Task VerifyMetaDataIsGeneratedCorrectly() Assert.True(tagsProperty.IsNullable); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/InheritanceTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/InheritanceTests.cs index 7a0d876ee4..37276c05f3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/InheritanceTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/InheritanceTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/MultipleEntitySetOnSameClrTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/MultipleEntitySetOnSameClrTypeTests.cs index 0d8681f567..d2b10c9522 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/MultipleEntitySetOnSameClrTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/MultipleEntitySetOnSameClrTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Threading.Tasks; using Microsoft.AspNet.OData.Builder; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTests.cs index 9b991a5121..eeb41d4c49 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; @@ -417,4 +421,4 @@ public class ODataActionTests_RatedProduct : ODataActionTests_Product { public int Rating { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTestsProxyGeneratedCode.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTestsProxyGeneratedCode.cs index 81f4cfc9d4..40a4743099 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTestsProxyGeneratedCode.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataActionTestsProxyGeneratedCode.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34003 diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataMessageWrapper.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataMessageWrapper.cs index 96c4e7b3ac..3092dd243a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataMessageWrapper.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/ODataMessageWrapper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/PropertyTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/PropertyTests.cs index 57be070c8e..3e31278038 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/PropertyTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/PropertyTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesE2ETests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesE2ETests.cs index cc14719e1f..a28549f766 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesE2ETests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesE2ETests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -336,4 +340,3 @@ public class UserEntity public Base Base { get; set; } } } - diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesModels.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesModels.cs index a77602e502..1f7b7c2293 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesModels.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/RecursiveComplexTypesModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; @@ -66,4 +70,3 @@ public class Derived : Base public Base Base { get; set; } } } - diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialCharactersLinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialCharactersLinkGenerationTests.cs index 19aaa17795..07c23d6c58 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialCharactersLinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialCharactersLinkGenerationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialPrimaryKeyTypesInLinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialPrimaryKeyTypesInLinkGenerationTests.cs index d2dd2d706b..abfd9e5e90 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialPrimaryKeyTypesInLinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/SpecialPrimaryKeyTypesInLinkGenerationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/UnicodeLinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/UnicodeLinkGenerationTests.cs index 91bd54cc9e..50a7c59af8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/UnicodeLinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ModelBuilder/UnicodeLinkGenerationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeModel.cs index 371eb9958f..b04e789eba 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -105,4 +109,4 @@ public static IEdmModel GetConventionalEdmModel() return modelBuilder.GetEdmModel(); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeTests.cs index 77fcfc26dc..172c5d94f4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/NavigationPropertyOnComplexTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net; @@ -384,4 +388,3 @@ private static string ExecuteAndVerifyQueryRequest(string requestUri, string con } } } - diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/PeopleController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/PeopleController.cs index a7802b306d..090a10c93c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/PeopleController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/PeopleController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/PeopleRepository.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/PeopleRepository.cs index efa679baaa..9c44f93aae 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/PeopleRepository.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/PeopleRepository.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -178,4 +182,4 @@ public PeopleRepository() }; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/SelectImprovementOnComplexTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/SelectImprovementOnComplexTypeTests.cs index 3e9b35a44d..6a17154809 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/SelectImprovementOnComplexTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/NavigationPropertyOnComplexType/SelectImprovementOnComplexTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net; @@ -532,4 +536,3 @@ private static string ExecuteAndVerifyQueryRequest(string requestUri, string equ } } } - diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountController.cs index 698dbcb00f..4348d7be29 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountDataModel.cs index c9ecb0305e..792ea7a4ca 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountEdmModel.cs index 83ba461807..f4d483aa74 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Data.Entity; using Microsoft.AspNet.OData.Builder; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountTest.cs index b742153b88..f675ac2b8e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataCountTest/CountTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net; @@ -92,4 +96,4 @@ public async Task NegativeCountTest(string url) Assert.DoesNotContain("@odata.count", result); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataHelper.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataHelper.cs index e63c360d0d..47e26537f3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataHelper.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByController.cs index 7a50fa6631..c3950a480a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByDataModel.cs index ac2e965a3b..2ff9e4d085 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations; using System.ComponentModel.DataAnnotations.Schema; @@ -76,4 +80,3 @@ public abstract class OrderedItem public int ExpectedOrder { get; set; } } } - diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByEdmModel.cs index e4671d14f6..79c21c40fa 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Data.Entity; using Microsoft.AspNet.OData.Builder; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByTest.cs index 8a9649e944..42011fc0f3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataOrderByTest/OrderByTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -93,4 +97,4 @@ public int GetHashCode(T obj) } } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/LinkGenerationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/LinkGenerationTests.cs index b2bea0102d..2ba509fc92 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/LinkGenerationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/LinkGenerationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/UnicodeRouteTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/UnicodeRouteTests.cs index c79e8ec32e..e10f5a9d66 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/UnicodeRouteTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandler/UnicodeRouteTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandlerExtensions.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandlerExtensions.cs index df0e59c320..b135d05051 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandlerExtensions.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ODataPathHandlerExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeControllers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeControllers.cs index 885901aa00..bd7bb3bc88 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeControllers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -627,4 +631,3 @@ public ITestActionResult ResetDataSource() #endregion } - diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeDataModel.cs index 1e7f97f12f..6b983f0e4d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.OpenType { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeEdmModel.cs index b145ef2394..2d1763db3b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/OpenTypeEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedClient.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedClient.cs index cc7e56f8be..f504cca060 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedClient.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedClient.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34014 diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedServiceReference.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedServiceReference.cs index 838685e7a8..ac682ecb64 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedServiceReference.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedServiceReference.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34011 @@ -547,4 +554,4 @@ public enum Gender [global::Microsoft.OData.Client.OriginalNameAttribute("Male")] Male = 1 } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedServiceReferenceForOpenType.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedServiceReferenceForOpenType.cs index 96a9e5949c..ce788e3348 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedServiceReferenceForOpenType.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedServiceReferenceForOpenType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.OpenType.Typed.Client { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedTest.cs index 4d861e99b1..e48a66b535 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/OpenType/TypedTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -1668,4 +1672,4 @@ private async Task ResetDatasource() return response; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasDataSource.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasDataSource.cs index f195b3f301..0c416de191 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasDataSource.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasDataSource.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasTest.cs index 8a4e05e497..d2bc1f3953 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ParameterAlias/ParameterAliasTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/AnonymousTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/AnonymousTypeTests.cs index 417c8e3326..ae2a857a6e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/AnonymousTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/AnonymousTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ComplextTypeCollectionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ComplextTypeCollectionTests.cs index 49a790898e..c641d4c6c6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ComplextTypeCollectionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ComplextTypeCollectionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Controllers/FilterTestsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Controllers/FilterTestsController.cs index 474127d65a..523aae34b6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Controllers/FilterTestsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Controllers/FilterTestsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Controllers/TopSkipOrderByTestsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Controllers/TopSkipOrderByTestsController.cs index e0d99ddf3f..36ccd5c188 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Controllers/TopSkipOrderByTestsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Controllers/TopSkipOrderByTestsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/EFWideCustomer.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/EFWideCustomer.cs index 1bc9b88d90..919f359dd8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/EFWideCustomer.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/EFWideCustomer.cs @@ -1,4 +1,11 @@ -// +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +// // This code was generated by a tool (EFWideCustomer.tt). // Changes to this file may cause incorrect behavior and will be lost if the code is regenerated. @@ -2040,4 +2047,3 @@ public class CustomProperties5 public string Prop2000 {get; set;} } } - diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/EnumTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/EnumTypeTests.cs index c141854c69..98a773e307 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/EnumTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/EnumTypeTests.cs @@ -1,6 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. - +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.Test.E2E.AspNet.OData.QueryComposition { diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/FilterTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/FilterTests.cs index 14ba6aaf2b..8c233336f7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/FilterTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/FilterTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/FuzzingController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/FuzzingController.cs index 16d148eaad..7953613729 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/FuzzingController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/FuzzingController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/Models.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/Models.cs index 64d42ac46f..3ac8ef31ad 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/Models.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/Models.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/QueryBuilder.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/QueryBuilder.cs index 513469ae75..ac6fa2d49b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/QueryBuilder.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/Fuzzing/QueryBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Diagnostics.CodeAnalysis; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs index 89dc179b3c..9717744b20 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/GlobalQueryableFilterTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InheritanceQueryableTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InheritanceQueryableTests.cs index 14d3afc1d9..aa0412dd60 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InheritanceQueryableTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InheritanceQueryableTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InvalidQueryTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InvalidQueryTests.cs index 0ce87624d0..783d0728de 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InvalidQueryTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/InvalidQueryTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsOfController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsOfController.cs index b27f61145d..afc14a69fd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsOfController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsOfController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData; using Microsoft.Test.E2E.AspNet.OData.Common.Controllers; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsOfModels.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsOfModels.cs index cd3da9c008..d373a4ea01 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsOfModels.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsOfModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofDataSource.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofDataSource.cs index bf030d6be0..2ad261012e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofDataSource.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofDataSource.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofEdmModel.cs index 46c02167df..dcc82928a6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.Test.E2E.AspNet.OData.Common.Execution; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofFunctionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofFunctionTests.cs index 1dc737a4da..439c52f26c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofFunctionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/IsOf/IsofFunctionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSelectExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSelectExpandTests.cs index a5d30d2216..71b29c8b89 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSelectExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSelectExpandTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSingleResultSelectExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSingleResultSelectExpandTests.cs index 4d32991e0f..4dbb121b58 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSingleResultSelectExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonSingleResultSelectExpandTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonpQueryableTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonpQueryableTests.cs index 1df64195b0..a3c20e4e75 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonpQueryableTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/JsonpQueryableTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/NestedClassTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/NestedClassTests.cs index c3630ff11f..1bfeea69d4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/NestedClassTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/NestedClassTests.cs @@ -1,4 +1,9 @@ -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ODataQueryOptionsTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ODataQueryOptionsTests.cs index 8001b9c99f..ed907c5ccc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ODataQueryOptionsTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ODataQueryOptionsTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/OrderByTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/OrderByTests.cs index 1d7e459b83..b045228d3b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/OrderByTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/OrderByTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -197,4 +201,4 @@ public class OrderByOrder public OrderByAddress ShippingAddress { get; set; } public bool IsAGift { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/PrimitiveTypesTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/PrimitiveTypesTests.cs index b691d4da61..25a4b1ea14 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/PrimitiveTypesTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/PrimitiveTypesTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/QueryFuzzingTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/QueryFuzzingTests.cs index 9112cba892..fb11481bb1 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/QueryFuzzingTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/QueryFuzzingTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SecurityTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SecurityTests.cs index e1d48656ce..8021b95463 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SecurityTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SecurityTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE2x using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandEFTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandEFTests.cs index c4e49f00f7..1dcaec19ac 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandEFTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandEFTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -375,4 +379,4 @@ public class EFSelectOrder public int Id { get; set; } public virtual EFSelectCustomer SelectCustomer { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandTests.cs index 299e437841..951a34f038 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectExpandTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectTypeExplosionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectTypeExplosionTests.cs index 86605d7700..4c41b29c5a 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectTypeExplosionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SelectTypeExplosionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ServerTypeTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ServerTypeTests.cs index 0273244093..dd032cbd9e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ServerTypeTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ServerTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SingleResultSelectExpandTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SingleResultSelectExpandTests.cs index 33b5ae3fca..4abf95814d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SingleResultSelectExpandTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/SingleResultSelectExpandTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/StableOrderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/StableOrderTests.cs index d6a5146e1d..9d0c3c4578 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/StableOrderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/StableOrderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/TopSkipOrderByTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/TopSkipOrderByTests.cs index 99da74a5d9..7bdff1a9b2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/TopSkipOrderByTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/TopSkipOrderByTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/UriParserTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/UriParserTests.cs index e4caa4db4a..81abe61494 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/UriParserTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/UriParserTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Threading.Tasks; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ValidatorTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ValidatorTests.cs index 95c1dd9d3e..fac805d956 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ValidatorTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/QueryComposition/ValidatorTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ActionRoutingConventionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ActionRoutingConventionTests.cs index 00b49b2b7a..d1e6f1f353 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ActionRoutingConventionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ActionRoutingConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AddRelatedObjectTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AddRelatedObjectTests.cs index e73797c7a0..7b940c3f61 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AddRelatedObjectTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AddRelatedObjectTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AttributeRoutingTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AttributeRoutingTests.cs index 597073c26d..8a8a8a6976 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AttributeRoutingTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/AttributeRoutingTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesController.cs index 250da36c7e..9b6cc83643 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData; using Microsoft.AspNet.OData.Routing; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesModel.cs index 41d0ff5947..8b9a1e4478 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesTest.cs index 88080bc2ed..43ba94cf4d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/DynamicProperties/DynamicPropertiesTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataRouteTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataRouteTests.cs index e31612d0d0..40c20b3151 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataRouteTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataRouteTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataValueProviderTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataValueProviderTests.cs index a2e54d2163..af026da6b7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataValueProviderTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/ODataValueProviderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/RefRoutingConventionTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/RefRoutingConventionTests.cs index 8e73405d4c..2e7c9915d8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/RefRoutingConventionTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/RefRoutingConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/UnqualifiedNameCallRoutingTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/UnqualifiedNameCallRoutingTests.cs index 2a6472a22e..8012be0924 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/UnqualifiedNameCallRoutingTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Routing/UnqualifiedNameCallRoutingTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingControllers.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingControllers.cs index 0c23dd6e53..ab6bc5df25 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingControllers.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingDataModel.cs index 7824db93fc..197e12d58d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingTests.cs index 148ae3533e..681ad9f384 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/ServerSidePaging/ServerSidePagingTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Threading.Tasks; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultController.cs index 6900cc0e2a..1db481cf2d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultDataModel.cs index 0eb8f37aa6..bc118c2502 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Data.Entity; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultEdmModel.cs index 030f0e4102..9bb758f8f3 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.Test.E2E.AspNet.OData.Common.Execution; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultTests.cs index 3d245d2f9b..7d36273d74 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SingleResult/SingleResultTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/MonstersIncController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/MonstersIncController.cs index af416bf27f..ea903f570f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/MonstersIncController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/MonstersIncController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/ODataClient.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/ODataClient.cs index 285a510aac..3309a163d9 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/ODataClient.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/ODataClient.cs @@ -1,4 +1,11 @@ -//------------------------------------------------------------------------------ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +//------------------------------------------------------------------------------ // // This code was generated by a tool. // Runtime Version:4.0.30319.34011 @@ -658,4 +665,4 @@ public enum CompanyCategory Electronics = 2, Others = 3 } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/PartnersController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/PartnersController.cs index 47d957ab5e..d0728729d0 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/PartnersController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/PartnersController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonClientTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonClientTest.cs index e72d64a7af..18542dd830 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonClientTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonClientTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonDataModel.cs index 02f15ab782..bf9700c619 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonEdmModel.cs index ae2cba85b0..b6fe08af5f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonTest.cs index 470934f049..6968bdbe8e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/SingletonTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/UmbrellaController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/UmbrellaController.cs index a54d9eabdb..595b5fd81c 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/UmbrellaController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Singleton/UmbrellaController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialController.cs index dd5467048d..e1b88be73f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialEdmModel.cs index 35aca1ea56..f93ae60b0b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialFactory.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialFactory.cs index 77b6698ab5..98b6eae2ec 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialFactory.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -1354,4 +1358,4 @@ protected override void EndGeo() #endregion } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialModels.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialModels.cs index bc3e5bcf81..d183434f79 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialModels.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations; using Microsoft.Spatial; @@ -19,4 +23,4 @@ public class SpatialCustomer public GeometryPoint HomePoint { get; set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialTests.cs index fa9ed81df2..622eb40c71 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Spatial/SpatialTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net; @@ -174,4 +178,4 @@ public async Task UpdateSpatialEntity() Assert.Equal(HttpStatusCode.OK, response.StatusCode); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerController.cs index 8e0f4a72d1..4ad03c4818 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerMetadataTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerMetadataTest.cs index 7f668cf919..d4f3600408 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerMetadataTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerMetadataTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerPathHandler.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerPathHandler.cs index 508751a2ae..237dd59a1e 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerPathHandler.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerPathHandler.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Routing; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerPathSegment.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerPathSegment.cs index d1f88e1191..f1324380c8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerPathSegment.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerPathSegment.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Routing; using Microsoft.OData.Edm; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerRoutingConvention.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerRoutingConvention.cs index 3c6519812a..4a45cdc259 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerRoutingConvention.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Swagger/SwaggerRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Controllers/PartsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Controllers/PartsController.cs index 32edd1b98b..4c206c0228 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Controllers/PartsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Controllers/PartsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Controllers/ProductsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Controllers/ProductsController.cs index e0807f42ac..230aa769f2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Controllers/ProductsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Controllers/ProductsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Extensions/ODataVersionRouteConstraint.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Extensions/ODataVersionRouteConstraint.cs index e95b6134c0..8cb1713060 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Extensions/ODataVersionRouteConstraint.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Extensions/ODataVersionRouteConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Globalization; @@ -46,4 +50,4 @@ public bool Match( return true; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/ModelBuilder.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/ModelBuilder.cs index a5276fc49d..b5f878349d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/ModelBuilder.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/ModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http.OData.Builder; using Microsoft.Data.Edm; @@ -16,4 +20,4 @@ public static IEdmModel GetEdmModel() return builder.GetEdmModel(); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/Part.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/Part.cs index 39f1ccfaed..4db526baa7 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/Part.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/Part.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -26,4 +30,4 @@ public virtual ICollection Products set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/Product.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/Product.cs index 923944258e..df55a010bd 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/Product.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/Models/Product.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -24,4 +28,4 @@ public DateTime ManufactureDateTime set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/ODataV3WebApiConfig.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/ODataV3WebApiConfig.cs index 13144cbb8a..f892af1731 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/ODataV3WebApiConfig.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV3/ODataV3WebApiConfig.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using System.Web.Http.OData.Extensions; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Controllers/PartsV2Controller.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Controllers/PartsV2Controller.cs index 2fb329a009..eef004d469 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Controllers/PartsV2Controller.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Controllers/PartsV2Controller.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Controllers/ProductsV2Controller.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Controllers/ProductsV2Controller.cs index a44dad2ac4..f0d1b7b626 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Controllers/ProductsV2Controller.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Controllers/ProductsV2Controller.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Extensions/EntitySetVersioningRoutingConvention.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Extensions/EntitySetVersioningRoutingConvention.cs index 3980e5f0b1..b195e2df6b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Extensions/EntitySetVersioningRoutingConvention.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Extensions/EntitySetVersioningRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Routing.Conventions; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Extensions/ODataVersionRouteConstraint.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Extensions/ODataVersionRouteConstraint.cs index 95b6f35244..78d20b1b94 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Extensions/ODataVersionRouteConstraint.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Extensions/ODataVersionRouteConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Globalization; @@ -38,4 +42,4 @@ bool IHttpRouteConstraint.Match(HttpRequestMessage request, IHttpRoute route, st return true; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/ModelBuilder.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/ModelBuilder.cs index e85d55daf9..2eff36e73f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/ModelBuilder.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/ModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; @@ -16,4 +20,4 @@ public static IEdmModel GetEdmModel() return builder.GetEdmModel(); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/Part.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/Part.cs index 4bab90d035..51be5afd66 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/Part.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/Part.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -32,4 +36,4 @@ public virtual ICollection Products set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/Product.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/Product.cs index 981d4b38a5..25750bceda 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/Product.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/Models/Product.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -24,4 +28,4 @@ public DateTimeOffset ManufactureDateTime set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/ODataV4WebApiConfig.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/ODataV4WebApiConfig.cs index 76b3b3da4e..f735cd44aa 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/ODataV4WebApiConfig.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/ODataV4/ODataV4WebApiConfig.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using Microsoft.AspNet.OData.Extensions; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/SxSODataV3AndV4Test.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/SxSODataV3AndV4Test.cs index f37cb2359f..853b9472ab 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/SxSODataV3AndV4Test.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS/SxSODataV3AndV4Test.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Controllers/ProductsController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Controllers/ProductsController.cs index 998e8749b6..6507283625 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Controllers/ProductsController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Controllers/ProductsController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Extensions/ODataVersionRouteConstraint.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Extensions/ODataVersionRouteConstraint.cs index f45d36223b..4a7fb7d550 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Extensions/ODataVersionRouteConstraint.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Extensions/ODataVersionRouteConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -44,4 +48,4 @@ public bool Match( return true; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Models/ModelBuilder.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Models/ModelBuilder.cs index 5452b0be6e..4d208b2f68 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Models/ModelBuilder.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Models/ModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http.OData.Builder; using Microsoft.Data.Edm; @@ -15,4 +19,4 @@ public static IEdmModel GetEdmModel() return builder.GetEdmModel(); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Models/Product.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Models/Product.cs index 78a24a7449..493fffe6b6 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Models/Product.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/Models/Product.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -24,4 +28,4 @@ public DateTime ManufactureDateTime set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/ODataV3WebApiConfig.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/ODataV3WebApiConfig.cs index 8da9d72d91..0ffcd1b15b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/ODataV3WebApiConfig.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV3/ODataV3WebApiConfig.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Web.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Controllers/ProductsV2Controller.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Controllers/ProductsV2Controller.cs index 8af079ef2a..f46ac38003 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Controllers/ProductsV2Controller.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Controllers/ProductsV2Controller.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Extensions/ODataVersionRouteConstraint.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Extensions/ODataVersionRouteConstraint.cs index 42404ed360..4595ca9057 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Extensions/ODataVersionRouteConstraint.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Extensions/ODataVersionRouteConstraint.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -39,4 +43,4 @@ bool IHttpRouteConstraint.Match(HttpRequestMessage request, IHttpRoute route, st return true; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Models/ModelBuilder.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Models/ModelBuilder.cs index a39cbd0233..ca264e0125 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Models/ModelBuilder.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Models/ModelBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.OData.Edm; @@ -15,4 +19,4 @@ public static IEdmModel GetEdmModel() return builder.GetEdmModel(); } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Models/Product.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Models/Product.cs index ed8ae6e9a0..efe179202f 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Models/Product.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/Models/Product.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -24,4 +28,4 @@ public DateTimeOffset ManufactureDateTime set; } } -} \ No newline at end of file +} diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/ODataV4WebApiConfig.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/ODataV4WebApiConfig.cs index db394140fa..e9507b33d8 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/ODataV4WebApiConfig.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/ODataV4/ODataV4WebApiConfig.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Web.Http; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/SxSODataV3AndV4Test.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/SxSODataV3AndV4Test.cs index e460e55d83..0031831a5b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/SxSODataV3AndV4Test.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/SxS2/SxSODataV3AndV4Test.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationController.cs index 46e01744b5..54b608563d 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationDataModel.cs index 882c9baf0c..4920c62770 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationEdmModel.cs index f5626717d5..be5ab84d0b 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Builder; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationTest.cs index e264b10589..007e2e8d07 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UnboundOperation/UnboundOperationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveResolver.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveResolver.cs index b8a609ca42..24b6361bdf 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveResolver.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveResolver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.UriParser; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveTest.cs index 056bb55d4c..a747b0abcf 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/CaseInsensitiveTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/EnumPrefixFreeTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/EnumPrefixFreeTest.cs index c70b6549f5..fe7b8da173 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/EnumPrefixFreeTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/EnumPrefixFreeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UnqualifiedCallTest.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UnqualifiedCallTest.cs index 49d604b5a0..0148fb3541 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UnqualifiedCallTest.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UnqualifiedCallTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtensionDataModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtensionDataModel.cs index 1811d5a484..cfc81bd287 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtensionDataModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtensionDataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtenstionController.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtenstionController.cs index 451223a77e..35a9235c96 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtenstionController.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtenstionController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtenstionEdmModel.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtenstionEdmModel.cs index 0b26b64ac9..5d35eefcb2 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtenstionEdmModel.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriParserExtenstionEdmModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.OData.Edm; using Microsoft.Test.E2E.AspNet.OData.Common.Execution; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs index 7eeca70581..e8ffba66a4 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/UriParserExtension/UriResolverDependencyTestWithOldDefaultConfig.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net; diff --git a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Validation/DeltaOfTValidationTests.cs b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Validation/DeltaOfTValidationTests.cs index 1982765142..e42095c3dc 100644 --- a/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Validation/DeltaOfTValidationTests.cs +++ b/test/E2ETest/Microsoft.Test.E2E.AspNet.OData/Validation/DeltaOfTValidationTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations; using System.Net; diff --git a/test/PerfTest/WebApiPerformance.Service/App_Start/WebApiConfig.cs b/test/PerfTest/WebApiPerformance.Service/App_Start/WebApiConfig.cs index 4fb2e18dfb..195df4d8b2 100644 --- a/test/PerfTest/WebApiPerformance.Service/App_Start/WebApiConfig.cs +++ b/test/PerfTest/WebApiPerformance.Service/App_Start/WebApiConfig.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using Microsoft.AspNet.OData.Extensions; diff --git a/test/PerfTest/WebApiPerformance.Service/Controllers/ODataClrController.cs b/test/PerfTest/WebApiPerformance.Service/Controllers/ODataClrController.cs index ddc33c11b2..15255db77b 100644 --- a/test/PerfTest/WebApiPerformance.Service/Controllers/ODataClrController.cs +++ b/test/PerfTest/WebApiPerformance.Service/Controllers/ODataClrController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -39,4 +43,4 @@ public IHttpActionResult Post(ClassA a) return Ok(a); } } -} \ No newline at end of file +} diff --git a/test/PerfTest/WebApiPerformance.Service/Controllers/ODataEdmController.cs b/test/PerfTest/WebApiPerformance.Service/Controllers/ODataEdmController.cs index 3a60c345d4..2bd516149d 100644 --- a/test/PerfTest/WebApiPerformance.Service/Controllers/ODataEdmController.cs +++ b/test/PerfTest/WebApiPerformance.Service/Controllers/ODataEdmController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/PerfTest/WebApiPerformance.Service/Controllers/WebApiJsonController.cs b/test/PerfTest/WebApiPerformance.Service/Controllers/WebApiJsonController.cs index ac7c8b237f..5effb82bba 100644 --- a/test/PerfTest/WebApiPerformance.Service/Controllers/WebApiJsonController.cs +++ b/test/PerfTest/WebApiPerformance.Service/Controllers/WebApiJsonController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -22,4 +26,4 @@ public IEnumerable Get() return TestRepo.GetAs(n); } } -} \ No newline at end of file +} diff --git a/test/PerfTest/WebApiPerformance.Service/Global.asax.cs b/test/PerfTest/WebApiPerformance.Service/Global.asax.cs index d79797d74f..54d691c184 100644 --- a/test/PerfTest/WebApiPerformance.Service/Global.asax.cs +++ b/test/PerfTest/WebApiPerformance.Service/Global.asax.cs @@ -1,4 +1,11 @@ -using System.Web; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Web; using System.Web.Http; namespace WebApiPerformance.Service diff --git a/test/PerfTest/WebApiPerformance.Service/Models/TestRepo.cs b/test/PerfTest/WebApiPerformance.Service/Models/TestRepo.cs index a7c4c84cee..c97c13969f 100644 --- a/test/PerfTest/WebApiPerformance.Service/Models/TestRepo.cs +++ b/test/PerfTest/WebApiPerformance.Service/Models/TestRepo.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -70,4 +74,4 @@ public static IEdmModel GetModel() return model.GetEdmModel(); } } -} \ No newline at end of file +} diff --git a/test/PerfTest/WebApiPerformance.Service/Models/Types.cs b/test/PerfTest/WebApiPerformance.Service/Models/Types.cs index 3af3890bd7..f653f74440 100644 --- a/test/PerfTest/WebApiPerformance.Service/Models/Types.cs +++ b/test/PerfTest/WebApiPerformance.Service/Models/Types.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/PerfTest/WebApiPerformance.Service/Properties/AssemblyInfo.cs b/test/PerfTest/WebApiPerformance.Service/Properties/AssemblyInfo.cs index 51aaaca73b..f43aaf424a 100644 --- a/test/PerfTest/WebApiPerformance.Service/Properties/AssemblyInfo.cs +++ b/test/PerfTest/WebApiPerformance.Service/Properties/AssemblyInfo.cs @@ -1,4 +1,11 @@ -using System.Reflection; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/test/PerfTest/WebApiPerformance.Test/Common/TestServiceFixture.cs b/test/PerfTest/WebApiPerformance.Test/Common/TestServiceFixture.cs index 1b83b8ea66..82dd1d0541 100644 --- a/test/PerfTest/WebApiPerformance.Test/Common/TestServiceFixture.cs +++ b/test/PerfTest/WebApiPerformance.Test/Common/TestServiceFixture.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics; diff --git a/test/PerfTest/WebApiPerformance.Test/CustomerTest.cs b/test/PerfTest/WebApiPerformance.Test/CustomerTest.cs index 66a89765cb..80bdae4258 100644 --- a/test/PerfTest/WebApiPerformance.Test/CustomerTest.cs +++ b/test/PerfTest/WebApiPerformance.Test/CustomerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net; diff --git a/test/PerfTest/WebApiPerformance.Test/Properties/AssemblyInfo.cs b/test/PerfTest/WebApiPerformance.Test/Properties/AssemblyInfo.cs index 6d946742e3..91f69d2723 100644 --- a/test/PerfTest/WebApiPerformance.Test/Properties/AssemblyInfo.cs +++ b/test/PerfTest/WebApiPerformance.Test/Properties/AssemblyInfo.cs @@ -1,4 +1,11 @@ -using System.Reflection; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System.Reflection; using System.Runtime.CompilerServices; using System.Runtime.InteropServices; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ApplyTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ApplyTest.cs index ac751c3e6a..a9d6d60c6b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ApplyTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ApplyTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ChangeSetRequestItemTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ChangeSetRequestItemTest.cs index 97397c63f5..08fde10522 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ChangeSetRequestItemTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ChangeSetRequestItemTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -170,4 +174,4 @@ public void Dispose_DisposesAllHttpRequestMessages() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ChangeSetResponseItemTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ChangeSetResponseItemTest.cs index 6210dd4f23..ce6e050d04 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ChangeSetResponseItemTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ChangeSetResponseItemTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.IO; @@ -142,4 +146,4 @@ public void Dispose_DisposesAllHttpResponseMessages() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/DefaultODataBatchHandlerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/DefaultODataBatchHandlerTest.cs index 4b7a6fcf0b..b0eab87ceb 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/DefaultODataBatchHandlerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/DefaultODataBatchHandlerTest.cs @@ -1,5 +1,10 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + using System; using System.Collections.Generic; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpRequestMessage.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpRequestMessage.cs index bf1931cc56..38a53488c3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpRequestMessage.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpRequestMessage.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; @@ -14,4 +18,4 @@ protected override void Dispose(bool disposing) IsDisposed = true; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpResponseMessage.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpResponseMessage.cs index 12cfea33c1..d38dfdb954 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpResponseMessage.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpResponseMessage.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; @@ -14,4 +18,4 @@ protected override void Dispose(bool disposing) IsDisposed = true; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpServer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpServer.cs index cbafbbe63a..d6674f18f2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpServer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/MockHttpServer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -36,4 +40,4 @@ protected override Task SendAsync(HttpRequestMessage reques } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchContentTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchContentTest.cs index a72d0120e8..d30c72c3cb 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchContentTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchContentTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -166,4 +170,4 @@ private static ODataBatchContent CreateBatchContent(IEnumerable +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -138,4 +142,4 @@ public void SetODataContentId_SetsTheContentIdOnTheRequest() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchMiddlewareTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchMiddlewareTests.cs index bac8f4ccc4..97afe2ed91 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchMiddlewareTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchMiddlewareTests.cs @@ -1,4 +1,11 @@ -#if NETCORE +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +#if NETCORE using System.Net.Http; using System.Threading.Tasks; using Microsoft.AspNet.OData.Batch; @@ -81,4 +88,4 @@ public override Task ProcessBatchAsync(HttpContext context, RequestDelegate next } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchReaderExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchReaderExtensionsTest.cs index 04bcec4b8f..e4bddb6ed1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchReaderExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchReaderExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -155,4 +159,4 @@ public async Task CreateODataBatchResponseAsyncWhenNoAcceptHeader(string content } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchRequestHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchRequestHelper.cs index bb56d1b183..c8d94171ef 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchRequestHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchRequestHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -22,4 +26,4 @@ public static HttpMessageContent CreateODataRequestContent(HttpRequestMessage re } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchRequestItemTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchRequestItemTest.cs index c313475c99..06f8e02181 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchRequestItemTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchRequestItemTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchResponseItemTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchResponseItemTest.cs index 29b4f8a33c..f50c96668f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchResponseItemTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataBatchResponseItemTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -159,4 +163,4 @@ public async Task WriteMessageAsync_ResponseContainsContentId_IfHasContentIdInRe } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataHttpContentExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataHttpContentExtensions.cs index 33ae63512f..45a98fc426 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataHttpContentExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataHttpContentExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.ComponentModel; @@ -55,4 +59,4 @@ public static async Task GetODataMessageReaderAsync(this Htt } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataHttpContentExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataHttpContentExtensionsTest.cs index a3fa0095b8..bdad10187f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataHttpContentExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/ODataHttpContentExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Net.Http; @@ -31,4 +35,4 @@ public async Task GetODataMessageReaderAsync_ReturnsMessageReader() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/OperationRequestItemTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/OperationRequestItemTest.cs index ada9622d22..cf010f87b2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/OperationRequestItemTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/OperationRequestItemTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Net; @@ -88,4 +92,4 @@ public void Dispose_DisposesHttpRequestMessage() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/OperationResponseItemTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/OperationResponseItemTest.cs index 82a2e917c8..32c506727b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/OperationResponseItemTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/OperationResponseItemTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.IO; @@ -106,4 +110,4 @@ public void Dispose_DisposesHttpResponseMessage() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/UnbufferedODataBatchHandlerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/UnbufferedODataBatchHandlerTest.cs index 50902b8efc..7f83f26b85 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/UnbufferedODataBatchHandlerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Batch/UnbufferedODataBatchHandlerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -435,4 +439,4 @@ await ExceptionAssert.ThrowsArgumentNullAsync( } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ActionConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ActionConfigurationTest.cs index a8a6322189..9e031ce413 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ActionConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ActionConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindableOperationFinderAnnotationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindableOperationFinderAnnotationTest.cs index e50dee26b7..b5acca8fac 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindableOperationFinderAnnotationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindableOperationFinderAnnotationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindingPathConfigurationOfTStructuralTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindingPathConfigurationOfTStructuralTypeTest.cs index 0d4ee5a2fb..04efb6a283 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindingPathConfigurationOfTStructuralTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindingPathConfigurationOfTStructuralTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindingPathHelperTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindingPathHelperTest.cs index 0b5abab49f..ff2f72223e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindingPathHelperTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/BindingPathHelperTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/CollectionPropertyConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/CollectionPropertyConfigurationTest.cs index 17e6185e64..44e768262c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/CollectionPropertyConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/CollectionPropertyConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ComplexTypeConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ComplexTypeConfigurationTest.cs index b1e944df0d..3edb2c79e3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ComplexTypeConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ComplexTypeConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ComplexTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ComplexTypeTest.cs index 3dd00ce8d6..18445dbe3f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ComplexTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ComplexTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ContainmentPathBuilderTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ContainmentPathBuilderTest.cs index 440dcf260b..a5387aed20 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ContainmentPathBuilderTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ContainmentPathBuilderTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ActionLinkGenerationConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ActionLinkGenerationConventionTest.cs index 828c25e2a0..2bca3b79b5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ActionLinkGenerationConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ActionLinkGenerationConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/AssociationSetDiscoveryConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/AssociationSetDiscoveryConventionTest.cs index be8a6a2c18..5dc007c4b1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/AssociationSetDiscoveryConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/AssociationSetDiscoveryConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ActionOnDeleteAttributeConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ActionOnDeleteAttributeConventionTest.cs index 3e9927cf78..2fd7d295a4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ActionOnDeleteAttributeConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ActionOnDeleteAttributeConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeConventionTests.cs index db66a92a47..a13454a8c5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeEdmPropertyConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeEdmPropertyConventionTests.cs index b67b8864ba..bfb22f5952 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeEdmPropertyConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeEdmPropertyConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeEdmTypeConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeEdmTypeConventionTests.cs index 406ac77bd5..e2a3b6844f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeEdmTypeConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/AttributeEdmTypeConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ColumnAttributeEdmPropertyConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ColumnAttributeEdmPropertyConventionTest.cs index 3c325575d2..9a6b576b45 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ColumnAttributeEdmPropertyConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ColumnAttributeEdmPropertyConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations.Schema; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ComplexTypeAttributeConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ComplexTypeAttributeConventionTests.cs index 04356724b5..d8f3ff92fe 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ComplexTypeAttributeConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ComplexTypeAttributeConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Builder.Conventions.Attributes; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ConcurrencyCheckAttributeEdmPropertyConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ConcurrencyCheckAttributeEdmPropertyConventionTest.cs index f69966be22..d5d1b55281 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ConcurrencyCheckAttributeEdmPropertyConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ConcurrencyCheckAttributeEdmPropertyConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DataContractAttributeEdmTypeConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DataContractAttributeEdmTypeConventionTests.cs index 2690b2a5f1..e5628107ba 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DataContractAttributeEdmTypeConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DataContractAttributeEdmTypeConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DataMemberAttributeEdmPropertyConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DataMemberAttributeEdmPropertyConventionTest.cs index 57ad7a5411..c82e478d0e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DataMemberAttributeEdmPropertyConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DataMemberAttributeEdmPropertyConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DefaultValueAttributeEdmPropertyConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DefaultValueAttributeEdmPropertyConventionTests.cs index a87850b033..eca418c9a9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DefaultValueAttributeEdmPropertyConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/DefaultValueAttributeEdmPropertyConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel; using System.ComponentModel.DataAnnotations; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ForeignKeyAttributeConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ForeignKeyAttributeConventionTest.cs index c9c6438268..e8ec203e9c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ForeignKeyAttributeConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/ForeignKeyAttributeConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations.Schema; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/IgnoreDataMemberAttributeEdmPropertyConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/IgnoreDataMemberAttributeEdmPropertyConventionTests.cs index 76a1a63e90..e81cfa994a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/IgnoreDataMemberAttributeEdmPropertyConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/IgnoreDataMemberAttributeEdmPropertyConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/KeyAttributeEdmPropertyConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/KeyAttributeEdmPropertyConventionTests.cs index 277b71b449..3a737ba861 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/KeyAttributeEdmPropertyConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/KeyAttributeEdmPropertyConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/NotMappedAttributeConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/NotMappedAttributeConventionTests.cs index 183aba38f5..1bf4af199c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/NotMappedAttributeConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/NotMappedAttributeConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations.Schema; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/RequiredAttributeEdmPropertyConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/RequiredAttributeEdmPropertyConventionTests.cs index 5ea2579f81..4cb5753bc8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/RequiredAttributeEdmPropertyConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/RequiredAttributeEdmPropertyConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/TimestampAttributeEdmPropertyConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/TimestampAttributeEdmPropertyConventionTests.cs index a3c1940f70..462bb6cde9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/TimestampAttributeEdmPropertyConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/Attributes/TimestampAttributeEdmPropertyConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ConventionsHelpersTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ConventionsHelpersTests.cs index 8dfc736a70..386cf02157 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ConventionsHelpersTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ConventionsHelpersTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/EntityKeyConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/EntityKeyConventionTests.cs index def91bbe10..737afdc8b7 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/EntityKeyConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/EntityKeyConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.ComponentModel.DataAnnotations.Schema; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ForeignKeyDiscoveryConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ForeignKeyDiscoveryConventionTest.cs index edc6f9b134..d1c62f471b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ForeignKeyDiscoveryConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ForeignKeyDiscoveryConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/FunctionLinkGenerationConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/FunctionLinkGenerationConventionTest.cs index 1875a5de65..206b05164b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/FunctionLinkGenerationConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/FunctionLinkGenerationConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/NavigationLinksGenerationConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/NavigationLinksGenerationConventionTest.cs index 4372553e51..8f6b9d0010 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/NavigationLinksGenerationConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/NavigationLinksGenerationConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ODataConventionModelBuilderTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ODataConventionModelBuilderTests.cs index 2e06cef0e8..12adbee7c8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ODataConventionModelBuilderTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/ODataConventionModelBuilderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/RecursiveComplexTypesModels.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/RecursiveComplexTypesModels.cs index 26cbe64481..0b2a41c0cb 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/RecursiveComplexTypesModels.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/RecursiveComplexTypesModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; @@ -66,4 +70,3 @@ public class Derived : Base public Base Base { get; set; } } } - diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/RecursiveComplexTypesTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/RecursiveComplexTypesTests.cs index f38e3e7708..ca7cd94ab9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/RecursiveComplexTypesTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/RecursiveComplexTypesTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; @@ -164,4 +168,4 @@ public class JustDerived public Derived Derived { get; set; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/SelfLinksGenerationConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/SelfLinksGenerationConventionTest.cs index fc35782009..883fe67835 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/SelfLinksGenerationConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/Conventions/SelfLinksGenerationConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/DynamicPropertyDictionaryAnnotationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/DynamicPropertyDictionaryAnnotationTest.cs index 197b33ecb4..2798071990 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/DynamicPropertyDictionaryAnnotationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/DynamicPropertyDictionaryAnnotationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EdmModelAsserts.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EdmModelAsserts.cs index 9eb5e248db..de21040cf8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EdmModelAsserts.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EdmModelAsserts.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EdmTypeConfigurationExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EdmTypeConfigurationExtensionsTest.cs index 449f51a262..2c3090c0b2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EdmTypeConfigurationExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EdmTypeConfigurationExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetConfigurationTest.cs index ba0c63dc47..fa66a45de0 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetLinkConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetLinkConfigurationTest.cs index 20f4b16436..df983794c7 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetLinkConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetLinkConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetTest.cs index 89de514cc2..5cd6806f09 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntitySetTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntityTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntityTypeTest.cs index 39e0f8eb0d..e50165981e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntityTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EntityTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EnumTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EnumTypeTest.cs index ec55c650f4..a45e748936 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EnumTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/EnumTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -1245,4 +1249,4 @@ public enum Life [EnumMember(Value = "soso")] NotTooBad } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/FunctionConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/FunctionConfigurationTest.cs index a21fe626ed..ed4af6de8f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/FunctionConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/FunctionConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/LinkGenerationHelpersTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/LinkGenerationHelpersTest.cs index dd688b1267..f3d9d25f1b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/LinkGenerationHelpersTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/LinkGenerationHelpersTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/LowerCamelCaserTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/LowerCamelCaserTest.cs index 134555b041..fead34f87a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/LowerCamelCaserTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/LowerCamelCaserTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -171,4 +175,4 @@ public class LowerCamelCaserModelAliasEntity public double Price { get; set; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/MetadataTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/MetadataTest.cs index ac182e793e..6c5343e245 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/MetadataTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/MetadataTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/MockNavigationSourceLinkBuilderAnnotation.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/MockNavigationSourceLinkBuilderAnnotation.cs index be5d5d7ece..4f1bac049e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/MockNavigationSourceLinkBuilderAnnotation.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/MockNavigationSourceLinkBuilderAnnotation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/NavigationPropertyConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/NavigationPropertyConfigurationTest.cs index 4e6ef99c60..f58662c88c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/NavigationPropertyConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/NavigationPropertyConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/NavigationSourceLinkBuilderAnnotationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/NavigationSourceLinkBuilderAnnotationTest.cs index 3c2ca5fcef..7149a1c9d4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/NavigationSourceLinkBuilderAnnotationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/NavigationSourceLinkBuilderAnnotationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataConventionModelBuilderHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataConventionModelBuilderHelper.cs index f92b071605..7f8c4f5e70 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataConventionModelBuilderHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataConventionModelBuilderHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Test.Abstraction; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataModelBuilderTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataModelBuilderTest.cs index f2709150a9..08111e31e4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataModelBuilderTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataModelBuilderTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataUtilsLearningTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataUtilsLearningTests.cs index 4750fd2dd2..5e441801e7 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataUtilsLearningTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ODataUtilsLearningTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.IO; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/OperationLinkBuilderTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/OperationLinkBuilderTests.cs index 64fdabb57d..0ba5de86d3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/OperationLinkBuilderTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/OperationLinkBuilderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ParameterConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ParameterConfigurationTest.cs index a9076064d0..b15ffc7494 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ParameterConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ParameterConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PrimitivePropertyConfigurationExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PrimitivePropertyConfigurationExtensionsTest.cs index 581760a564..7f35314eca 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PrimitivePropertyConfigurationExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PrimitivePropertyConfigurationExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PrimitiveTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PrimitiveTypeTest.cs index 8a3ab6de69..44600dcc0c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PrimitiveTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PrimitiveTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ProgrammableBuilderApiTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ProgrammableBuilderApiTest.cs index 309a764a21..c2211703e1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ProgrammableBuilderApiTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/ProgrammableBuilderApiTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertyConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertyConfigurationTest.cs index 4587e66e80..151a9fb7e8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertyConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertyConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertyPairSelectorVisitorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertyPairSelectorVisitorTest.cs index 5596c0c9bd..8be301c1d0 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertyPairSelectorVisitorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertyPairSelectorVisitorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertySelectorVisitorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertySelectorVisitorTest.cs index ef4c3582dc..65fdb777a2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertySelectorVisitorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/PropertySelectorVisitorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonConfigurationTest.cs index e73bf86c43..649843bd35 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonLinkConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonLinkConfigurationTest.cs index d3b47bb33b..18bcdb3428 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonLinkConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonLinkConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonTest.cs index a1bef64613..c6cd0a1a91 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/SingletonTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/StructuralTypeConfigurationOfTStructuralTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/StructuralTypeConfigurationOfTStructuralTypeTest.cs index 937e08678e..a223814634 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/StructuralTypeConfigurationOfTStructuralTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/StructuralTypeConfigurationOfTStructuralTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/StructuralTypeConfigurationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/StructuralTypeConfigurationTest.cs index f42780334c..9ec8a036db 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/StructuralTypeConfigurationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/StructuralTypeConfigurationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Address.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Address.cs index 0fa363b0c0..d6984d06c2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Address.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Address.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Builder.TestModels { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Client.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Client.cs index 1b77c791a1..dfaec423f8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Client.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Client.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Color.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Color.cs index 461a0e4cee..389c9602ef 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Color.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Color.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; @@ -12,4 +16,4 @@ public enum Color Green = 2, Blue = 4 } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Company.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Company.cs index b6f8d35298..8af94a54f5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Company.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Company.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Customer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Customer.cs index 33551ec5cd..96b0bbf6cb 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Customer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Customer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/DateTimeModel.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/DateTimeModel.cs index 7cb2ed2783..c0df1e95d1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/DateTimeModel.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/DateTimeModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Employee.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Employee.cs index fb8e253dfe..17b219f600 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Employee.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Employee.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/EnumModel.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/EnumModel.cs index 5fcc44446f..e0a062fe2c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/EnumModel.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/EnumModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common.Types; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Gift.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Gift.cs index f23e9c61f5..e533524e57 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Gift.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Gift.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Builder.TestModels { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/InheritanceModels.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/InheritanceModels.cs index 61984b8c9a..8e4a29720e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/InheritanceModels.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/InheritanceModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/ModelAlias.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/ModelAlias.cs index cd46d62520..8fcbbf4671 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/ModelAlias.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/ModelAlias.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Runtime.Serialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/MyOrder.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/MyOrder.cs index fd1300f8e3..d25ad837bb 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/MyOrder.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/MyOrder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/MySpecialOrder.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/MySpecialOrder.cs index 4de879b943..76b7ed0a5c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/MySpecialOrder.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/MySpecialOrder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Order.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Order.cs index ff86a263fa..3e11a01e9e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Order.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/Order.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderCancellation.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderCancellation.cs index 2982cd8e38..5aa590a6c0 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderCancellation.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderCancellation.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Builder.TestModels { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderHeader.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderHeader.cs index 87db8afe81..9f5f8cb208 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderHeader.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderHeader.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Builder.TestModels { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderLine.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderLine.cs index 0c8fe3519b..1317f65df1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderLine.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/OrderLine.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Builder.TestModels { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/PropertyAlias.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/PropertyAlias.cs index 7921085157..9b502476a2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/PropertyAlias.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/PropertyAlias.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Runtime.Serialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/RecursiveModel.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/RecursiveModel.cs index 3b0c154983..4cebb77d56 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/RecursiveModel.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/RecursiveModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/SpecialOrderLine.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/SpecialOrderLine.cs index 7a817655e9..0676e3f01a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/SpecialOrderLine.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/SpecialOrderLine.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Builder.TestModels { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/ZipCode.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/ZipCode.cs index d886a496f1..f504eed6e9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/ZipCode.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Builder/TestModels/ZipCode.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Builder.TestModels { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ClrPropertyInfoAnnotationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ClrPropertyInfoAnnotationTest.cs index 4234bd13b6..2914f2c4a8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ClrPropertyInfoAnnotationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ClrPropertyInfoAnnotationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common; using Xunit; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/CultureReplacer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/CultureReplacer.cs index 953f880f99..db39c50983 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/CultureReplacer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/CultureReplacer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Globalization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/DataAttribute.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/DataAttribute.cs index 1d3be56fd3..45bb624ec1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/DataAttribute.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/DataAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/EnumHelperTestBase.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/EnumHelperTestBase.cs index 04e325a75d..d188a64924 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/EnumHelperTestBase.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/EnumHelperTestBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Xunit; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ExceptionAssert.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ExceptionAssert.cs index 49ba1b52ca..d5b08c25ce 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ExceptionAssert.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ExceptionAssert.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MediaTypeHeaderValueComparer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MediaTypeHeaderValueComparer.cs index 361c0ce53b..a8e40cc580 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MediaTypeHeaderValueComparer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MediaTypeHeaderValueComparer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -88,4 +92,4 @@ private static int CompareBasedOnQualityFactor(ParsedMediaTypeHeaderValue parsed return 0; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MemberHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MemberHelper.cs index 84c40c1383..6495016423 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MemberHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MemberHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockAssembly.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockAssembly.cs index 227e656c07..659fd5a195 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockAssembly.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockAssembly.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockPropertyInfo.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockPropertyInfo.cs index 88a88899c4..f4a714e0bf 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockPropertyInfo.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockPropertyInfo.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockType.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockType.cs index bc33c635e3..85394a315c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockType.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/MockType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ParsedMediaTypeHeaderValue.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ParsedMediaTypeHeaderValue.cs index 9a26165e01..6575848994 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ParsedMediaTypeHeaderValue.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ParsedMediaTypeHeaderValue.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http.Headers; @@ -109,4 +113,4 @@ public double QualityFactor } } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Platform.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Platform.cs index da635d7f88..4aac00d5f1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Platform.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Platform.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PlatformInfo.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PlatformInfo.cs index 34887bd52b..991ae5f2b5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PlatformInfo.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PlatformInfo.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PortReserver.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PortReserver.cs index 062fc3c3cf..9cb32114ac 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PortReserver.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PortReserver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PreAppStartTestHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PreAppStartTestHelper.cs index ed86024fe2..cb238a6c51 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PreAppStartTestHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/PreAppStartTestHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ReflectionAssert.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ReflectionAssert.cs index b4b9459b61..356396b7cf 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ReflectionAssert.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ReflectionAssert.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq.Expressions; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ReplaceCultureAttribute.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ReplaceCultureAttribute.cs index d0705b4c52..756c07ed72 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ReplaceCultureAttribute.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/ReplaceCultureAttribute.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Globalization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/StreamAssert.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/StreamAssert.cs index acaceab937..35f52f7ffc 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/StreamAssert.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/StreamAssert.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TaskExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TaskExtensions.cs index 50a244fd62..89137ec655 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TaskExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TaskExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; @@ -34,4 +38,4 @@ public static void RethrowFaultedTaskException(this Task task) throw task.Exception.GetBaseException(); } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TestFile.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TestFile.cs index 41ae8b93f5..9f972dc694 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TestFile.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TestFile.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TestHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TestHelper.cs index 83ef882209..9045aeaf1a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TestHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TestHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Globalization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TheoryDataSet.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TheoryDataSet.cs index 9c30c8ebf0..3e7d2523c5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TheoryDataSet.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TheoryDataSet.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TypeAssert.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TypeAssert.cs index 89a3ddd1b9..054d375fac 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TypeAssert.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/TypeAssert.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Xunit; @@ -162,4 +166,4 @@ public static void HasProperties(Type type, TypeProperties typeProperties, Type } } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/ByteEnum.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/ByteEnum.cs index 3d0e005839..95dae77965 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/ByteEnum.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/ByteEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Types { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/FlagsEnum.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/FlagsEnum.cs index b361adc95b..cfb0fa13a3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/FlagsEnum.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/FlagsEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/INameAndIdContainer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/INameAndIdContainer.cs index 8b2154a46f..9b9c1f8f86 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/INameAndIdContainer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/INameAndIdContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Types { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/LongEnum.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/LongEnum.cs index fa2d6adf94..cc3b83d10c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/LongEnum.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/LongEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Types { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/SByteEnum.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/SByteEnum.cs index 399f58d875..7d49a4d3ec 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/SByteEnum.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/SByteEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Types { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/ShortEnum.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/ShortEnum.cs index 1bbedc9850..ed37e19dfe 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/ShortEnum.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/ShortEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Types { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/SimpleEnum.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/SimpleEnum.cs index da6765f4c7..311b550115 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/SimpleEnum.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/SimpleEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Types { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/UIntEnum.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/UIntEnum.cs index f3a87e8226..73e5d4ea99 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/UIntEnum.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/UIntEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Types { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/UShortEnum.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/UShortEnum.cs index 3ef91ae3d8..475f8f5ab9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/UShortEnum.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/Types/UShortEnum.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Types { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/VersionTestHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/VersionTestHelper.cs index 727a11ade0..e529231979 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/VersionTestHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Common/VersionTestHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ContentIdHelpersTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ContentIdHelpersTest.cs index b1a30cef4d..7415f96339 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ContentIdHelpersTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ContentIdHelpersTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ContextUtil.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ContextUtil.cs index f24879ac2c..c9186fdf15 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ContextUtil.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ContextUtil.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Net.Http; @@ -71,4 +75,4 @@ public static HttpActionDescriptor CreateActionDescriptor() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DateAndTimeOfDayTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DateAndTimeOfDayTest.cs index 537edaea8f..41d1a18574 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DateAndTimeOfDayTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DateAndTimeOfDayTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DateTimeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DateTimeTest.cs index f80d6cf33c..4dab75fcb1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DateTimeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DateTimeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DefaultContainerBuilderTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DefaultContainerBuilderTests.cs index f025bde18a..113f7d6934 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DefaultContainerBuilderTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DefaultContainerBuilderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.Extensions.DependencyInjection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DeltaSetOfTTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DeltaSetOfTTest.cs new file mode 100644 index 0000000000..8ad086696d --- /dev/null +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DeltaSetOfTTest.cs @@ -0,0 +1,333 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.Linq; +using Microsoft.AspNet.OData.Builder; +using Xunit; + +namespace Microsoft.AspNet.OData.Test +{ + public class DeltaSetOfTTest + { + public static List friends; + + [Fact] + public void DeltaSet_Patch() + { + //Arrange + var lstId = new List(); + lstId.Add("Id"); + var deltaSet = new DeltaSet(lstId); + + var edmChangedObj1 = new Delta(); + edmChangedObj1.TrySetPropertyValue("Id", 1); + edmChangedObj1.TrySetPropertyValue("Name", "Friend1"); + + var edmChangedObj2 = new Delta(); + edmChangedObj2.TrySetPropertyValue("Id", 2); + edmChangedObj2.TrySetPropertyValue("Name", "Friend2"); + + deltaSet.Add(edmChangedObj1); + deltaSet.Add(edmChangedObj2); + + var friends = new List(); + friends.Add(new Friend { Id = 1, Name = "Test1" }); + friends.Add(new Friend { Id = 2, Name = "Test2" }); + + //Act + deltaSet.Patch(friends); + + //Assert + Assert.Equal(2, friends.Count); + Assert.Equal("Friend1", friends[0].Name); + Assert.Equal("Friend2", friends[1].Name); + + } + + + [Fact] + public void DeltaSet_Add_WrongItem_ThrowsError() + { + //Assign + + var edmChangedObjectcollection = new DeltaSet(new List() { "Id" }); + + var edmChangedObj1 = new Delta(); + edmChangedObj1.TrySetPropertyValue("Id", 1); + edmChangedObj1.TrySetPropertyValue("Name", "Friend1"); + + //Act & Assert + Assert.Throws(() => edmChangedObjectcollection.Add(edmChangedObj1)); + } + + + + [Fact] + public void DeltaSet_Patch_WithDeletes() + { + //Arrange + var deltaSet = new DeltaSet(new List() { "Id" }); + + + var edmChangedObj1 = new Delta(); + edmChangedObj1.TrySetPropertyValue("Id", 1); + edmChangedObj1.TrySetPropertyValue("Name", "Friend1"); + + var edmChangedObj2 = new DeltaDeletedEntityObject(); + edmChangedObj2.TrySetPropertyValue("Id", 2); + + + deltaSet.Add(edmChangedObj1); + deltaSet.Add(edmChangedObj2); + + friends = new List(); + friends.Add(new Friend { Id = 1, Name = "Test1" }); + friends.Add(new Friend { Id = 2, Name = "Test2" }); + + //Act + deltaSet.Patch(new APIHandlerFactory()); + + //Assert + Assert.Single(friends); + Assert.Equal("Friend1", friends[0].Name); + } + + [Fact] + public void DeltaSet_Patch_WithInstanceAnnotations() + { + //Arrange + + var deltaSet = new DeltaSet((new List() { "Id" })); + + + var edmChangedObj1 = new Delta(); + edmChangedObj1.TrySetPropertyValue("Id", 1); + edmChangedObj1.TrySetPropertyValue("Name", "Friend1"); + + var annotation = new ODataInstanceAnnotationContainer(); + annotation.AddResourceAnnotation("NS.Test1", 1); + edmChangedObj1.TrySetPropertyValue("InstanceAnnotations", annotation); + + var edmChangedObj2 = new DeltaDeletedEntityObject(); + edmChangedObj2.TrySetPropertyValue("Id", 2); + + edmChangedObj2.TransientInstanceAnnotationContainer = new ODataInstanceAnnotationContainer(); + edmChangedObj2.TransientInstanceAnnotationContainer.AddResourceAnnotation("Core.ContentID", 3); + + deltaSet.Add(edmChangedObj1); + deltaSet.Add(edmChangedObj2); + + friends = new List(); + friends.Add(new Friend { Id = 1, Name = "Test1" }); + friends.Add(new Friend { Id = 2, Name = "Test2" }); + + //Act + var coll = deltaSet.Patch(new APIHandlerFactory()).ToArray(); + + //Assert + Assert.Single(friends); + Assert.Equal("Friend1", friends[0].Name); + var changedObj = coll[0] as Delta; + Assert.NotNull(changedObj); + + object obj; + changedObj.TryGetPropertyValue("InstanceAnnotations",out obj); + var annotations = (obj as IODataInstanceAnnotationContainer).GetResourceAnnotations(); + Assert.Equal("NS.Test1", annotations.First().Key); + Assert.Equal(1, annotations.First().Value); + + DeltaDeletedEntityObject changedObj1 = coll[1] as DeltaDeletedEntityObject; + Assert.NotNull(changedObj1); + + annotations = changedObj1.TransientInstanceAnnotationContainer.GetResourceAnnotations(); + Assert.Equal("Core.ContentID", annotations.First().Key); + Assert.Equal(3, annotations.First().Value); + } + + [Fact] + public void DeltaSet_Patch_WithNestedDelta() + { + //Arrange + + var lstId = new List(); + lstId.Add("Id"); + + var deltaSet = new DeltaSet(lstId); + + var deltaSet1 = new DeltaSet(lstId); + + var edmNewObj1 = new Delta(); + edmNewObj1.TrySetPropertyValue("Id", 1); + edmNewObj1.TrySetPropertyValue("Name", "NewFriend1"); + + var edmNewObj2 = new Delta(); + edmNewObj2.TrySetPropertyValue("Id", 2); + edmNewObj2.TrySetPropertyValue("Name", "NewFriend2"); + + deltaSet1.Add(edmNewObj1); + deltaSet1.Add(edmNewObj2); + + var deltaSet2 = new DeltaSet(lstId); + + var edmNewObj21 = new Delta(); + edmNewObj21.TrySetPropertyValue("Id", 3); + edmNewObj21.TrySetPropertyValue("Name", "NewFriend3"); + + var edmNewObj22 = new Delta(); + edmNewObj22.TrySetPropertyValue("Id", 4); + edmNewObj22.TrySetPropertyValue("Name", "NewFriend4"); + + deltaSet2.Add(edmNewObj21); + deltaSet2.Add(edmNewObj22); + + var edmChangedObj1 = new Delta(); + edmChangedObj1.TrySetPropertyValue("Id", 1); + edmChangedObj1.TrySetPropertyValue("Name", "Friend1"); + edmChangedObj1.TrySetPropertyValue("NewFriends", deltaSet1); + + var edmChangedObj2 = new Delta(); + edmChangedObj2.TrySetPropertyValue("Id", 2); + edmChangedObj2.TrySetPropertyValue("Name", "Friend2"); + edmChangedObj2.TrySetPropertyValue("NewFriends", deltaSet2); + + deltaSet.Add(edmChangedObj1); + deltaSet.Add(edmChangedObj2); + + friends = new List(); + friends.Add(new Friend { Id = 1, Name = "Test1" }); + friends.Add(new Friend { Id = 2, Name = "Test2", NewFriends= new List() { new NewFriend {Id=3, Name="Test33" }, new NewFriend { Id = 4, Name = "Test44" } } }); + + //Act + deltaSet.Patch(new APIHandlerFactory()); + + //Assert + Assert.Equal(2, friends.Count); + Assert.Equal("Friend1", friends[0].Name); + Assert.Equal("Friend2", friends[1].Name); + + Assert.Equal(2, friends[0].NewFriends.Count); + Assert.Equal(2, friends[1].NewFriends.Count); + + Assert.Equal("NewFriend1", friends[0].NewFriends[0].Name); + Assert.Equal("NewFriend2", friends[0].NewFriends[1].Name); + Assert.Equal("NewFriend3", friends[1].NewFriends[0].Name); + Assert.Equal("NewFriend4", friends[1].NewFriends[1].Name); + } + + } + + public class APIHandlerFactory : ODataAPIHandlerFactory + { + public override IODataAPIHandler GetHandler(NavigationPath navigationPath) + { + if (navigationPath != null) + { + var pathItems = navigationPath.GetNavigationPathItems(); + + if (pathItems == null) + { + switch (navigationPath.NavigationPathName) + { + case "Friend": + return new FriendPatchHandler(); + + default: + return null; + } + } + } + + return null; + } + } + public class FriendPatchHandler : ODataAPIHandler + { + public override IODataAPIHandler GetNestedHandler(Friend parent, string navigationPropertyName) + { + return new NewFriendPatchHandler(parent); + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out Friend createdObject, out string errorMessage) + { + createdObject = new Friend(); + DeltaSetOfTTest.friends.Add(createdObject); + errorMessage = string.Empty; + return ODataAPIResponseStatus.Success; + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + int id = Int32.Parse( keyValues.First().Value.ToString()); + + DeltaSetOfTTest.friends.Remove(DeltaSetOfTTest.friends.First(x => x.Id == id)); + errorMessage = string.Empty; + + return ODataAPIResponseStatus.Success; + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out Friend originalObject, out string errorMessage) + { + int id = Int32.Parse(keyValues.First().Value.ToString()); + originalObject = DeltaSetOfTTest.friends.First(x => x.Id == id); + errorMessage = string.Empty; + + return ODataAPIResponseStatus.Success; + } + } + + public class NewFriendPatchHandler : ODataAPIHandler + { + Friend parent; + public NewFriendPatchHandler(Friend parent) + { + this.parent = parent; + } + + public override IODataAPIHandler GetNestedHandler(NewFriend parent, string navigationPropertyName) + { + throw new NotImplementedException(); + } + + public override ODataAPIResponseStatus TryCreate(IDictionary keyValues, out NewFriend createdObject, out string errorMessage) + { + createdObject = new NewFriend(); + if(parent.NewFriends == null) + { + parent.NewFriends = new List(); + } + + parent.NewFriends.Add(createdObject); + errorMessage = string.Empty; + return ODataAPIResponseStatus.Success; + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + int id = Int32.Parse(keyValues.First().Value.ToString()); + + parent.NewFriends.Remove(parent.NewFriends.First(x => x.Id == id)); + errorMessage = string.Empty; + + return ODataAPIResponseStatus.Success; + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out NewFriend originalObject, out string errorMessage) + { + errorMessage = string.Empty; + originalObject = null; + + if(parent.NewFriends == null) + { + return ODataAPIResponseStatus.NotFound; + } + + int id = Int32.Parse(keyValues.First().Value.ToString()); + originalObject = parent.NewFriends.FirstOrDefault(x => x.Id == id); + errorMessage = string.Empty; + + return originalObject!=null? ODataAPIResponseStatus.Success : ODataAPIResponseStatus.NotFound; + } + } +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DeltaTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DeltaTest.cs index 8df0d45d29..99d97661bd 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DeltaTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DeltaTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; @@ -49,7 +53,7 @@ public static IEnumerable DeltaModelPropertyNamesData { MethodInfo getDefaultValue = typeof(DeltaTest).GetMethod("GetDefaultValue"); - var defaultValues = typeof(DeltaModel).GetProperties().Select(p => new[] { p.Name, getDefaultValue.MakeGenericMethod(p.PropertyType).Invoke(obj: null, parameters: null) }); + IEnumerable defaultValues = typeof(DeltaModel).GetProperties().Select(p => new[] { p.Name, getDefaultValue.MakeGenericMethod(p.PropertyType).Invoke(obj: null, parameters: null) }); return defaultValues.Concat(new object[][] { new object[] { "StringProperty" , "42" }, @@ -86,8 +90,7 @@ public void RoundTrip_Properties(string propertyName, object value) { Delta delta = new Delta(); - Type propertyType; - Assert.True(delta.TryGetPropertyType(propertyName, out propertyType)); + Assert.True(delta.TryGetPropertyType(propertyName, out _)); Assert.True(delta.TrySetPropertyValue(propertyName, value)); @@ -99,27 +102,102 @@ public void RoundTrip_Properties(string propertyName, object value) [Fact] public void CanGetChangedPropertyNames() { - var original = new AddressEntity { ID = 1, City = "Redmond", State = "NY", StreetAddress = "21110 NE 44th St", ZipCode = 98074 }; + dynamic delta = new Delta(); + IDelta idelta = delta as IDelta; + // modify in the way we expect the formatter too. + idelta.TrySetPropertyValue("City", "Sammamish"); + Assert.Single(idelta.GetChangedPropertyNames()); + Assert.Equal("City", idelta.GetChangedPropertyNames().Single()); + Assert.Equal(4, idelta.GetUnchangedPropertyNames().Count()); + + // read the property back + object city; + Assert.True(idelta.TryGetPropertyValue("City", out city)); + Assert.Equal("Sammamish", city); + + // modify the way people will through custom code + delta.StreetAddress = "23213 NE 15th Ct"; + string[] mods = idelta.GetChangedPropertyNames().ToArray(); + Assert.Equal(2, mods.Count()); + Assert.Contains("StreetAddress", mods); + Assert.Contains("City", mods); + Assert.Equal("23213 NE 15th Ct", delta.StreetAddress); + Assert.Equal(3, idelta.GetUnchangedPropertyNames().Count()); + } + [Fact] + public void CanGetChangedPropertyNamesButOnlyUpdatable() + { dynamic delta = new Delta(); - var idelta = delta as IDelta; + IDelta idelta = delta as IDelta; // modify in the way we expect the formatter too. idelta.TrySetPropertyValue("City", "Sammamish"); Assert.Single(idelta.GetChangedPropertyNames()); Assert.Equal("City", idelta.GetChangedPropertyNames().Single()); + Assert.Equal(4, idelta.GetUnchangedPropertyNames().Count()); // read the property back - object city = null; + object city; Assert.True(idelta.TryGetPropertyValue("City", out city)); Assert.Equal("Sammamish", city); + // limit updatable properties + delta.UpdatableProperties.Clear(); + delta.UpdatableProperties.Add("City"); + delta.UpdatableProperties.Add("StreetAddress"); + // modify the way people will through custom code delta.StreetAddress = "23213 NE 15th Ct"; - var mods = idelta.GetChangedPropertyNames().ToArray(); + string[] mods = idelta.GetChangedPropertyNames().ToArray(); Assert.Equal(2, mods.Count()); Assert.Contains("StreetAddress", mods); Assert.Contains("City", mods); Assert.Equal("23213 NE 15th Ct", delta.StreetAddress); + Assert.Empty(idelta.GetUnchangedPropertyNames()); + + // try to modify an un-updatable property + idelta.TrySetPropertyValue("State", "IA"); + mods = idelta.GetChangedPropertyNames().ToArray(); + Assert.Equal(2, mods.Count()); + Assert.Contains("StreetAddress", mods); + Assert.Contains("City", mods); + Assert.Null(delta.State); + Assert.Empty(idelta.GetUnchangedPropertyNames()); + + // limit a property that has been updated + delta.UpdatableProperties.Remove("StreetAddress"); + mods = idelta.GetChangedPropertyNames().ToArray(); + Assert.Single(mods); + Assert.Contains("City", mods); + Assert.Null(delta.State); + Assert.Empty(idelta.GetUnchangedPropertyNames()); + + // enable a property that has not been updated + delta.UpdatableProperties.Add("State"); + mods = idelta.GetChangedPropertyNames().ToArray(); + Assert.Single(mods); + Assert.Contains("City", mods); + Assert.Null(delta.State); + Assert.Single(idelta.GetUnchangedPropertyNames()); + Assert.Equal("State", idelta.GetUnchangedPropertyNames().Single()); + + // enable a property that doesn't exist + delta.UpdatableProperties.Add("Bogus"); + mods = idelta.GetChangedPropertyNames().ToArray(); + Assert.Single(mods); + Assert.Contains("City", mods); + Assert.Null(delta.State); + Assert.Single(idelta.GetUnchangedPropertyNames()); + Assert.Equal("State", idelta.GetUnchangedPropertyNames().Single()); + + // set a property that doesn't exist + Assert.False(delta.TrySetPropertyValue("Bogus", "Bad")); + mods = idelta.GetChangedPropertyNames().ToArray(); + Assert.Single(mods); + Assert.Contains("City", mods); + Assert.Null(delta.State); + Assert.Single(idelta.GetUnchangedPropertyNames()); + Assert.Equal("State", idelta.GetUnchangedPropertyNames().Single()); } [Fact] @@ -136,7 +214,7 @@ public void CanReadUnmodifiedDefaultValuesFromDelta() [Fact] public void CanPatch() { - var original = new AddressEntity { ID = 1, City = "Redmond", State = "WA", StreetAddress = "21110 NE 44th St", ZipCode = 98074 }; + AddressEntity original = new AddressEntity { ID = 1, City = "Redmond", State = "WA", StreetAddress = "21110 NE 44th St", ZipCode = 98074 }; dynamic delta = new Delta(); delta.City = "Sammamish"; @@ -156,7 +234,7 @@ public void CanPatch() public void CanPatch_OpenType() { // Arrange - var address = new SimpleOpenAddress + SimpleOpenAddress address = new SimpleOpenAddress { City = "City", Street = "Street", @@ -168,7 +246,7 @@ public void CanPatch_OpenType() }; PropertyInfo propertyInfo = typeof(SimpleOpenAddress).GetProperty("Properties"); - var delta = new Delta(typeof(SimpleOpenAddress), null, propertyInfo); + Delta delta = new Delta(typeof(SimpleOpenAddress), null, propertyInfo); delta.TrySetPropertyValue("City", "ChangedCity"); delta.TrySetPropertyValue("IntProp", 1); @@ -189,7 +267,7 @@ public void CanPatch_OpenType() public void CanPut_OpenType() { // Arrange - var address = new SimpleOpenAddress + SimpleOpenAddress address = new SimpleOpenAddress { City = "City", Street = "Street", @@ -201,7 +279,7 @@ public void CanPut_OpenType() }; PropertyInfo propertyInfo = typeof(SimpleOpenAddress).GetProperty("Properties"); - var delta = new Delta(typeof(SimpleOpenAddress), null, propertyInfo); + Delta delta = new Delta(typeof(SimpleOpenAddress), null, propertyInfo); delta.TrySetPropertyValue("City", "ChangedCity"); delta.TrySetPropertyValue("IntProp", 1); @@ -218,12 +296,12 @@ public void CanPut_OpenType() [Fact] public void CanCopyUnchangedValues() { - var original = new AddressEntity { ID = 1, City = "Redmond", State = "WA", StreetAddress = "21110 NE 44th St", ZipCode = 98074 }; + AddressEntity original = new AddressEntity { ID = 1, City = "Redmond", State = "WA", StreetAddress = "21110 NE 44th St", ZipCode = 98074 }; dynamic delta = new Delta(); delta.City = "Sammamish"; delta.StreetAddress = "23213 NE 15th Ct"; - var idelta = delta as Delta; + Delta idelta = delta as Delta; idelta.CopyUnchangedValues(original); // unchanged values have been reset to defaults Assert.Equal(0, original.ID); @@ -237,12 +315,12 @@ public void CanCopyUnchangedValues() [Fact] public void CanPut() { - var original = new AddressEntity { ID = 1, City = "Redmond", State = "WA", StreetAddress = "21110 NE 44th St", ZipCode = 98074 }; + AddressEntity original = new AddressEntity { ID = 1, City = "Redmond", State = "WA", StreetAddress = "21110 NE 44th St", ZipCode = 98074 }; dynamic delta = new Delta(); delta.City = "Sammamish"; delta.StreetAddress = "23213 NE 15th Ct"; - var idelta = delta as Delta; + Delta idelta = delta as Delta; idelta.Put(original); // unchanged values have been reset to defaults @@ -259,7 +337,7 @@ public void CanClear() { dynamic delta = new Delta(); delta.StreetAddress = "Test"; - var idelta = delta as IDelta; + IDelta idelta = delta as IDelta; Assert.Single(idelta.GetChangedPropertyNames()); idelta.Clear(); Assert.Empty(idelta.GetChangedPropertyNames()); @@ -268,7 +346,7 @@ public void CanClear() [Fact] public void CanCreateDeltaOfDerivedTypes() { - var delta = new Delta(typeof(Derived)); + Delta delta = new Delta(typeof(Derived)); Assert.IsType(delta.GetInstance()); } @@ -343,8 +421,29 @@ public void Put_DoesNotClear_NonUpdatableProperties() // Arrange string expectedString = "hello, world"; int expectedInt = 24; - var delta = new Delta(typeof(Base), new[] { "BaseInt" }); + Delta delta = new Delta(typeof(Base), new[] { "BaseInt" }); + delta.TrySetPropertyValue("BaseInt", expectedInt); + + Base entity = new Base { BaseInt = 42, BaseString = expectedString }; + + // Act + delta.Put(entity); + + // Assert + Assert.Equal(expectedInt, entity.BaseInt); + Assert.Equal(expectedString, entity.BaseString); + } + + [Fact] + public void Put_DoesNotClear_ChangedNonUpdatableProperties() + { + // Arrange + string expectedString = "hello, world"; + int expectedInt = 24; + Delta delta = new Delta(typeof(Base)); delta.TrySetPropertyValue("BaseInt", expectedInt); + delta.UpdatableProperties.Clear(); + delta.UpdatableProperties.Add("BaseInt"); Base entity = new Base { BaseInt = 42, BaseString = expectedString }; @@ -356,6 +455,36 @@ public void Put_DoesNotClear_NonUpdatableProperties() Assert.Equal(expectedString, entity.BaseString); } + [Fact] + public void Patch_DoesNotSet_ChangedUpdatableProperties() + { + AddressEntity original = new AddressEntity { ID = 1, City = "Redmond", State = "WA", StreetAddress = "21110 NE 44th St", ZipCode = 98074 }; + + dynamic delta = new Delta(); + delta.City = "Sammamish"; + delta.StreetAddress = "23213 NE 15th Ct"; + + IDelta idelta = delta as IDelta; + string[] mods = idelta.GetChangedPropertyNames().ToArray(); + Assert.Equal(2, mods.Count()); + Assert.Contains("StreetAddress", mods); + Assert.Contains("City", mods); + + delta.UpdatableProperties.Clear(); + delta.UpdatableProperties.Add("City"); + + delta.Patch(original); + // unchanged + Assert.Equal(1, original.ID); + Assert.Equal("WA", original.State); + Assert.Equal("21110 NE 44th St", original.StreetAddress); + Assert.Equal(98074, original.ZipCode); + // changed + Assert.Equal("Sammamish", original.City); + + Assert.Equal(delta.GetChangedPropertyNames(), new[] { "City" }); + } + [Fact] public void Patch_ClearsAndAddsTo_CollectionPropertiesWithNoSetter() { @@ -456,10 +585,7 @@ public void CopyUnchangedValues_UnRelatedType_Throws_Argument() } public static TheoryDataSet ODataFormatter_Can_Read_Delta_DataSet - { - get - { - return new TheoryDataSet() + => new TheoryDataSet() { { "IntProperty", "23", 23 }, { "LongProperty", String.Format(CultureInfo.InvariantCulture, "'{0}'", Int64.MaxValue), Int64.MaxValue }, // longs are serialized as strings in odata json @@ -481,8 +607,6 @@ public static TheoryDataSet ODataFormatter_Can_Read_Delt { "CollectionProperty", "[ 1, 2, 3 ]", new Collection { 1, 2, 3} }, { "ComplexModelCollectionProperty", "[ { 'ComplexIntProperty' : 42 } ]", new Collection { new ComplexModel { ComplexIntProperty = 42 } } } }; - } - } #if !NETCORE // TODO #939: Enable this test on AspNetCore. [Theory] @@ -524,18 +648,13 @@ public async Task ODataFormatter_Can_Read_Delta(string propertyName, string prop #endif public static TheoryDataSet ODataFormatter_Can_Read_Delta_DataSet_WithAlias - { - get - { - return new TheoryDataSet() + => new TheoryDataSet() { { "StringProperty", "StringPropertyAlias", "'42'", "42" }, { "ComplexModelProperty", "ComplexModelPropertyAlias", "{ 'ComplexIntPropertyAlias' : 42 }", new ComplexModelWithAlias { ComplexIntProperty = 42 } }, { "CollectionProperty", "CollectionPropertyAlias", "[ 1, 2, 3 ]", new Collection { 1, 2, 3} }, { "ComplexModelCollectionProperty", "ComplexModelCollectionPropertyAlias", "[ { 'ComplexIntPropertyAlias' : 42 } ]", new Collection { new ComplexModelWithAlias { ComplexIntProperty = 42 } } } }; - } - } #if !NETCORE // TODO #939: Enable this test on AspNetCore. [Theory] @@ -578,16 +697,11 @@ public async Task ODataFormatter_CanReadDelta_WithAlias(string propertyName, str #endif public static TheoryDataSet TypedDelta_Returns_Correct_ExpectedClrType_And_ActualType_DataSet - { - get - { - return new TheoryDataSet() + => new TheoryDataSet() { { typeof(Customer) }, { typeof(BellevueCustomer) } }; - } - } [Theory] [MemberData(nameof(TypedDelta_Returns_Correct_ExpectedClrType_And_ActualType_DataSet))] @@ -607,7 +721,7 @@ public void TypedDelta_Returns_Correct_ExpectedClrType_And_ActualType(Type actua public static T GetDefaultValue() { - return default(T); + return default; } private class DeltaModel diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DependencyInjectionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DependencyInjectionTests.cs index 841abe89f3..79ebc75385 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DependencyInjectionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DependencyInjectionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DollarFormatTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DollarFormatTest.cs index a940190d12..b9ba99045e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DollarFormatTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/DollarFormatTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Net.Http; @@ -74,4 +78,4 @@ public Customer Get() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ETagMessageHandlerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ETagMessageHandlerTest.cs index f0a6563633..26d69f55e6 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ETagMessageHandlerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ETagMessageHandlerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -337,4 +341,4 @@ protected override Task SendAsync(HttpRequestMessage reques } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmChangedObjectCollectionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmChangedObjectCollectionTest.cs index 895a0a76a2..e149241c3d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmChangedObjectCollectionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmChangedObjectCollectionTest.cs @@ -1,6 +1,15 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Test.Common; using Microsoft.OData.Edm; using Moq; @@ -8,6 +17,48 @@ namespace Microsoft.AspNet.OData.Test { + public class TypelessAPIHandlerFactory : ODataEdmAPIHandlerFactory + { + IEdmEntityType entityType; + IEdmStructuredObject employee; + + public TypelessAPIHandlerFactory(IEdmEntityType entityType) + { + this.entityType = entityType; + } + + public TypelessAPIHandlerFactory(IEdmEntityType entityType, IEdmStructuredObject employee) + { + this.entityType = entityType; + this.employee = employee; + } + + public override EdmODataAPIHandler GetHandler(NavigationPath navigationPath) + { + if (navigationPath != null) + { + var pathItems = navigationPath.GetNavigationPathItems(); + + if (pathItems == null) + { + switch (navigationPath.NavigationPathName) + { + case "UnTypedFriend": + case "Friend": + return new FriendTypelessPatchHandler(entityType); + + default: + return null; + } + } + + } + + return null; + } + + } + public class EdmChangedObjectCollectionTest { [Fact] @@ -32,5 +83,417 @@ public void GetEdmType_Returns_EdmTypeInitializedByCtor() Assert.Same(_entityType, collectionTypeReference.ElementType().Definition); } - } + + public static List friends = new List(); + + internal void InitFriends() + { + friends = new List(); + EdmEntityType _entityType = new EdmEntityType("Microsoft.AspNet.OData.Test", "Friend"); + _entityType.AddKeys(_entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32)); + _entityType.AddStructuralProperty("Name", EdmPrimitiveTypeKind.String); + + EdmEntityType _entityType1 = new EdmEntityType("Microsoft.AspNet.OData.Test", "NewFriend"); + _entityType1.AddKeys(_entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32)); + _entityType1.AddStructuralProperty("Name", EdmPrimitiveTypeKind.String); + + var friend1 = new EdmEntityObject(_entityType); + friend1.TrySetPropertyValue("Id", 1); + friend1.TrySetPropertyValue("Name", "Test1"); + + var friend2 = new EdmEntityObject(_entityType); + friend2.TrySetPropertyValue("Id", 2); + friend2.TrySetPropertyValue("Name", "Test2"); + + var nfriend1 = new EdmEntityObject(_entityType1); + nfriend1.TrySetPropertyValue("Id", 1); + nfriend1.TrySetPropertyValue("Name", "Test1"); + + var nfriend2 = new EdmEntityObject(_entityType1); + nfriend2.TrySetPropertyValue("Id", 2); + nfriend2.TrySetPropertyValue("Name", "Test2"); + + var nfriends = new List(); + nfriends.Add(nfriend1); + nfriends.Add(nfriend2); + + friend1.TrySetPropertyValue("NewFriends", nfriends); + + friends.Add(friend1); + friends.Add(friend2); + } + + + [Fact] + public void EdmChangedObjectCollection_Patch() + { + //Assign + InitFriends(); + EdmEntityType _entityType = new EdmEntityType("Microsoft.AspNet.OData.Test", "Friend"); + _entityType.AddKeys(_entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32)); + _entityType.AddStructuralProperty("Name", EdmPrimitiveTypeKind.String); + + var lstId = new List(); + lstId.Add("Id"); + var deltaSet = new EdmChangedObjectCollection(_entityType); + + var edmChangedObj1 = new EdmDeltaEntityObject(_entityType); + edmChangedObj1.TrySetPropertyValue("Id", 1); + edmChangedObj1.TrySetPropertyValue("Name", "Friend1"); + + var edmChangedObj2 = new EdmDeltaEntityObject(_entityType); + edmChangedObj2.TrySetPropertyValue("Id", 2); + edmChangedObj2.TrySetPropertyValue("Name", "Friend2"); + + deltaSet.Add(edmChangedObj1); + deltaSet.Add(edmChangedObj2); + + //Act + deltaSet.Patch(new TypelessAPIHandlerFactory(_entityType)); + + //Assert + Assert.Equal(2, friends.Count); + object obj; + friends[0].TryGetPropertyValue("Name", out obj); + Assert.Equal("Friend1", obj ); + friends[1].TryGetPropertyValue("Name", out obj); + Assert.Equal("Friend2", obj); + + } + + + [Fact] + public void EdmChangedObjectCollection_Patch_WithDeletes() + { + //Assign + InitFriends(); + EdmEntityType _entityType = new EdmEntityType("Microsoft.AspNet.OData.Test", "Friend"); + _entityType.AddKeys(_entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32)); + _entityType.AddStructuralProperty("Name", EdmPrimitiveTypeKind.String); + + var changedObjCollection = new EdmChangedObjectCollection(_entityType); + + var edmChangedObj1 = new EdmDeltaEntityObject(_entityType); + edmChangedObj1.TrySetPropertyValue("Id", 1); + edmChangedObj1.TrySetPropertyValue("Name", "Friend1"); + + var edmChangedObj2 = new EdmDeltaDeletedEntityObject(_entityType); + edmChangedObj2.TrySetPropertyValue("Id", 2); + edmChangedObj2.TrySetPropertyValue("Name", "Friend2"); + + changedObjCollection.Add(edmChangedObj1); + changedObjCollection.Add(edmChangedObj2); + + //Act + changedObjCollection.Patch(new TypelessAPIHandlerFactory(_entityType)); + + //Assert + Assert.Single(friends); + object obj; + friends[0].TryGetPropertyValue("Name", out obj); + Assert.Equal("Friend1", obj); + + } + + [Fact] + public void EdmChangedObjectCollection_Patch_WithInstanceAnnotations() + { + //Assign + InitFriends(); + EdmEntityType _entityType = new EdmEntityType("Microsoft.AspNet.OData.Test", "Friend"); + _entityType.AddKeys(_entityType.AddStructuralProperty("Id", EdmPrimitiveTypeKind.Int32)); + _entityType.AddStructuralProperty("Name", EdmPrimitiveTypeKind.String); + + var changedObjCollection = new EdmChangedObjectCollection(_entityType); + + var edmChangedObj1 = new EdmDeltaEntityObject(_entityType); + edmChangedObj1.TrySetPropertyValue("Id", 1); + edmChangedObj1.TrySetPropertyValue("Name", "Friend1"); + edmChangedObj1.PersistentInstanceAnnotationsContainer = new ODataInstanceAnnotationContainer(); + edmChangedObj1.PersistentInstanceAnnotationsContainer.AddResourceAnnotation("NS.Test", 1); + + var edmChangedObj2 = new EdmDeltaEntityObject(_entityType); + edmChangedObj2.TrySetPropertyValue("Id", 2); + edmChangedObj2.TrySetPropertyValue("Name", "Friend2"); + + changedObjCollection.Add(edmChangedObj1); + changedObjCollection.Add(edmChangedObj2); + + //Act + var coll= changedObjCollection.Patch(new TypelessAPIHandlerFactory(_entityType)); + + //Assert + Assert.Equal(2, friends.Count); + object obj; + friends[0].TryGetPropertyValue("Name", out obj); + Assert.Equal("Friend1", obj); + + var edmObj = coll[0] as EdmDeltaEntityObject; + + Assert.Equal("NS.Test", edmObj.PersistentInstanceAnnotationsContainer.GetResourceAnnotations().First().Key); + Assert.Equal(1, edmObj.PersistentInstanceAnnotationsContainer.GetResourceAnnotations().First().Value); + + friends[1].TryGetPropertyValue("Name", out obj); + Assert.Equal("Friend2", obj); + } + + } + + public class Friend + { + [Key] + public int Id { get; set; } + public string Name { get; set; } + public List NewFriends { get; set; } + + public IODataInstanceAnnotationContainer InstanceAnnotations { get; set; } + } + + public class NewFriend + { + public int Id { get; set; } + public string Name { get; set; } + } + + public class FriendTypelessPatchHandler : EdmODataAPIHandler + { + IEdmEntityType entityType; + + public FriendTypelessPatchHandler(IEdmEntityType entityType) + { + this.entityType = entityType; + } + + public override ODataAPIResponseStatus TryCreate(IEdmChangedObject changedObject, out IEdmStructuredObject createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new EdmEntityObject(entityType); + + EdmChangedObjectCollectionTest.friends.Add(createdObject); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + var id = keyValues.First().Value.ToString(); + + foreach (var emp in EdmChangedObjectCollectionTest.friends) + { + object id1; + emp.TryGetPropertyValue("Id", out id1); + + if (id == id1.ToString()) + { + EdmChangedObjectCollectionTest.friends.Remove(emp); + + break; + } + } + + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out IEdmStructuredObject originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + var id = keyValues["Id"].ToString(); + + foreach (var friend in EdmChangedObjectCollectionTest.friends) + { + object id1; + friend.TryGetPropertyValue("Id", out id1); + + if (id == id1.ToString()) + { + originalObject = friend; + break; + } + } + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override EdmODataAPIHandler GetNestedHandler(IEdmStructuredObject parent, string navigationPropertyName) + { + switch (navigationPropertyName) + { + case "NewFriends": + return new NewFriendTypelessPatchHandler(parent, entityType.DeclaredNavigationProperties().First().Type.Definition.AsElementType() as IEdmEntityType); + default: + return null; + } + } + + } + + public class NewFriendTypelessPatchHandler : EdmODataAPIHandler + { + IEdmEntityType entityType; + EdmStructuredObject friend; + + public NewFriendTypelessPatchHandler(IEdmStructuredObject friend, IEdmEntityType entityType) + { + this.entityType = entityType; + this.friend = friend as EdmStructuredObject; + } + + public override ODataAPIResponseStatus TryCreate(IEdmChangedObject changedObject, out IEdmStructuredObject createdObject, out string errorMessage) + { + createdObject = null; + errorMessage = string.Empty; + + try + { + createdObject = new EdmEntityObject(entityType); + + object obj; + friend.TryGetPropertyValue("NewFriends", out obj); + + var nfriends = obj as List; + + nfriends.Add(createdObject); + + friend.TrySetPropertyValue("NewFriends", nfriends); + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryDelete(IDictionary keyValues, out string errorMessage) + { + errorMessage = string.Empty; + + try + { + object obj; + friend.TryGetPropertyValue("NewFriends", out obj); + + var nfriends = obj as List; + + var id = keyValues.First().Value.ToString(); + + foreach (var frnd in nfriends) + { + object id1; + frnd.TryGetPropertyValue("Id", out id1); + + if (id == id1.ToString()) + { + nfriends.Remove(frnd); + + break; + } + } + + + return ODataAPIResponseStatus.Success; + } + catch (Exception ex) + { + errorMessage = ex.Message; + + return ODataAPIResponseStatus.Failure; + } + } + + public override ODataAPIResponseStatus TryGet(IDictionary keyValues, out IEdmStructuredObject originalObject, out string errorMessage) + { + ODataAPIResponseStatus status = ODataAPIResponseStatus.Success; + errorMessage = string.Empty; + originalObject = null; + + try + { + object obj; + friend.TryGetPropertyValue("NewFriends", out obj); + + var nfriends = obj as List; + + var id = keyValues.First().Value.ToString(); + + foreach (var frnd in nfriends) + { + object id1; + frnd.TryGetPropertyValue("Id", out id1); + + if (id == id1.ToString()) + { + originalObject = frnd; + + break; + } + } + + + + if (originalObject == null) + { + status = ODataAPIResponseStatus.NotFound; + } + + } + catch (Exception ex) + { + status = ODataAPIResponseStatus.Failure; + errorMessage = ex.Message; + } + + return status; + } + + public override EdmODataAPIHandler GetNestedHandler(IEdmStructuredObject parent, string navigationPropertyName) + { + return null; + } + + } + } diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmComplexCollectionObjectTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmComplexCollectionObjectTest.cs index 13ee4e21f7..f2592e6f84 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmComplexCollectionObjectTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmComplexCollectionObjectTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaCollectionTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaCollectionTypeTest.cs index aa38e3e09c..5b39f176be 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaCollectionTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaCollectionTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaComplexObjectTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaComplexObjectTest.cs index 0a97f622d3..89eeba0f19 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaComplexObjectTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaComplexObjectTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaTypeTest.cs index c69c0ecfae..9ddda62e21 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmDeltaTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEntityCollectionObjectTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEntityCollectionObjectTest.cs index 1bf9fc9ce7..970886d6e5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEntityCollectionObjectTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEntityCollectionObjectTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEnumObjectCollectionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEnumObjectCollectionTest.cs index 6a015ff57b..d7abcfbc22 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEnumObjectCollectionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEnumObjectCollectionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEnumObjectTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEnumObjectTest.cs index e6b2d531de..3e1c4c81fe 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEnumObjectTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmEnumObjectTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmModelExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmModelExtensionsTest.cs index c235c7d7a1..a8f0e54763 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmModelExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmModelExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmStructuredObjectTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmStructuredObjectTest.cs index 7a29defafa..f3fc5ccece 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmStructuredObjectTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmStructuredObjectTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmTypeExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmTypeExtensionsTest.cs index 5101b09621..83a9f54caf 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmTypeExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EdmTypeExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnableNestedPathsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnableNestedPathsTest.cs new file mode 100644 index 0000000000..b9ce60c846 --- /dev/null +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnableNestedPathsTest.cs @@ -0,0 +1,445 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +#if NETCORE +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Linq; +using System.Net; +using System.Net.Http; +using System.Threading.Tasks; +using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Extensions; +using Microsoft.AspNet.OData.Formatter; +using Microsoft.AspNet.OData.Formatter.Deserialization; +using Microsoft.AspNet.OData.Test.Abstraction; +using Microsoft.AspNetCore.TestHost; +using Microsoft.OData; +using Microsoft.OData.Edm; +using Microsoft.OData.UriParser; +using Xunit; +using ODataPath = Microsoft.AspNet.OData.Routing.ODataPath; + +namespace Microsoft.AspNet.OData.Test +{ + public class EnableNestedPathsTest + { + private readonly ODataDeserializerProvider _deserializerProvider; + private readonly ODataResourceSetDeserializer _resourceSetDeserializer; + private readonly ODataResourceDeserializer _resourceDeserializer; + private readonly ODataPrimitiveDeserializer _primitiveDeserializer; + private readonly IEdmModel _model; + private readonly TestServer _server; + private readonly HttpClient _client; + private readonly EnableNestedPathsDatabase _db; + private readonly string _baseUrl = "http://localhost/odata/"; + + public EnableNestedPathsTest() + { + _deserializerProvider = ODataDeserializerProviderFactory.Create(); + _resourceSetDeserializer = new ODataResourceSetDeserializer(_deserializerProvider); + _resourceDeserializer = new ODataResourceDeserializer(_deserializerProvider); + _primitiveDeserializer = new ODataPrimitiveDeserializer(); + + ODataModelBuilder builder = ODataConventionModelBuilderFactory.Create(); + builder.EntitySet("EnableNestedPathsCustomers"); + builder.EntitySet("EnableNestedPathsProducts"); + builder.Singleton("EnableNestedPathsTopCustomer"); + builder.EntityType(); + + builder.EntityType() + .Function("GetMostPurchasedProduct") + .ReturnsFromEntitySet("EnableNestedPathsProduct"); + + builder.EntityType() + .Collection + .Action("SetDiscountRate"); + + _model = builder.GetEdmModel(); + + Type[] controllers = new Type[] { + typeof(EnableNestedPathsCustomersController), + typeof(EnableNestedPathsProductsController), + typeof(EnableNestedPathsTopCustomerController) + }; + + _server = TestServerFactory.Create(controllers, (config) => + { + config.MapODataServiceRoute("odata", "odata", _model); + config.Count().OrderBy().Filter().Expand().MaxTop(null).Select(); + }); + + _client = TestServerFactory.CreateClient(_server); + + _db = new EnableNestedPathsDatabase(); + } + + [Fact] + public async Task EnableNestedPaths_ReturnsEntiySetCollection() + { + // Arrange + string url = $"{_baseUrl}EnableNestedPathsCustomers"; + + // Act + HttpResponseMessage response = await _client.GetAsync(url); + + var stream = await response.Content.ReadAsStreamAsync(); + IEnumerable readCustomers = ReadCollectionResponse(stream, _model); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(_db.Customers, + readCustomers.Cast(), + new EnableNestedPathsCustomerComparer()); + } + + [Fact] + public async Task EnableNestedPaths_ReturnsEntityById() + { + // Arrange + string url = $"{_baseUrl}EnableNestedPathsCustomers(2)"; + + // Act + HttpResponseMessage response = await _client.GetAsync(url); + + var stream = await response.Content.ReadAsStreamAsync(); + var entitySet = _model.EntityContainer.FindEntitySet("EnableNestedPathsCustomers"); + var path = new ODataPath(new EntitySetSegment(entitySet)); + var readCustomer = ReadSingleResponse(stream, _model, path); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(_db.Customers.First(c => c.Id == 2), + readCustomer, + new EnableNestedPathsCustomerComparer()); + } + + [Fact] + public async Task EnableNestedPaths_ReturnsSingleton() + { + // Arrange + string url = $"{_baseUrl}EnableNestedPathsTopCustomer"; + + // Act + HttpResponseMessage response = await _client.GetAsync(url); + + var stream = await response.Content.ReadAsStreamAsync(); + var singleton = _model.EntityContainer.FindSingleton("EnableNestedPathsTopCustomer"); + var path = new ODataPath(new SingletonSegment(singleton)); + var readCustomer = ReadSingleResponse(stream, _model, path); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(_db.Customers.First(), + readCustomer, + new EnableNestedPathsCustomerComparer()); + } + + [Fact] + public async Task EnableNestedPaths_ReturnsPropertyOfSingleton() + { + // Arrange + string url = $"{_baseUrl}EnableNestedPathsTopCustomer/FavoriteProduct"; + + // Act + HttpResponseMessage response = await _client.GetAsync(url); + + var stream = await response.Content.ReadAsStreamAsync(); + var entitySet = _model.EntityContainer.FindEntitySet("EnableNestedPathsProducts"); + var path = new ODataPath(new EntitySetSegment(entitySet)); + var readProduct = ReadSingleResponse(stream, _model, path); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(_db.Customers.First().FavoriteProduct, + readProduct, + new EnableNestedPathsProductComparer()); + } + + [Fact] + public async Task EnableNestedPaths_ReturnsPrimitiveResults() + { + // Arrange + string url = $"{_baseUrl}EnableNestedPathsCustomers(1)/Name"; + + // Act + HttpResponseMessage response = await _client.GetAsync(url); + + var stream = await response.Content.ReadAsStreamAsync(); + var readName = ReadPrimitiveResponse(stream, _model); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(_db.Customers.First().Name, readName); + } + + + [Theory] + [InlineData("EnableNestedPathsCustomers(5)")] + [InlineData("EnableNestedPathsCustomers(5)/Name")] + // FavoriteProduct is null + [InlineData("EnableNestedPathsCustomers(2)/FavoriteProduct/Name")] + [InlineData("EnableNestedPathsCustomers(2)/FavoriteProduct")] + // Products(3) does not belong to Customers(1) + [InlineData("EnableNestedPathsCustomers(1)/Products(3)")] + [InlineData("EnableNestedPathsCustomers(1)/Products(3)/Name")] + [InlineData("EnableNestedPathsCustomers(2)/HomeAddress")] + [InlineData("EnableNestedPathsCustomers(3)/HomeAddress/City")] + [InlineData("EnableNestedPathsCustomers(3)/Products(2)")] + [InlineData("EnableNestedPathsCustomers(3)/Products(2)/Name")] + public async Task EnableNestedPaths_Returns404_WhenAccessNonExistentData(string path) + { + // Arrange + string url = $"{_baseUrl}{path}"; + + // Act + HttpResponseMessage response = await _client.GetAsync(url); + + // Assert + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + [Theory] + // Type Cast is currently not supported + [InlineData("EnableNestedPathsCustomers(1)/Microsoft.AspNet.OData.Test.EnableNestedPathsVipCustomer")] + // Functions and actions not supported + [InlineData("EnableNestedPathsCustomers(1)/GetMostPurchasedProduct()")] + [InlineData("EnableNestedPathsProducts/SetDiscountRate()")] + public async Task EnableNestedPaths_Returns404_WhenPathHasUnsupportedSegments(string path) + { + // Arrange + string url = $"{_baseUrl}{path}"; + + // Act + HttpResponseMessage response = await _client.GetAsync(url); + + // Assert + Assert.Equal(HttpStatusCode.NotFound, response.StatusCode); + } + + [Fact(Skip ="Temp")] + public async Task EnableNestedPaths_AppliedBeforeEnableQuery() + { + // Arrange + string url = $"{_baseUrl}EnableNestedPathsCustomers(1)/Products?$orderby=Id desc"; + + // Act + HttpResponseMessage response = await _client.GetAsync(url); + + var stream = await response.Content.ReadAsStreamAsync(); + var readCustomer = ReadCollectionResponse(stream, _model); + + // Assert + Assert.Equal(HttpStatusCode.OK, response.StatusCode); + Assert.Equal(_db.Customers.First().Products.OrderByDescending(p => p.Id).ToList(), + readCustomer, + new EnableNestedPathsProductComparer()); + } + + private IEnumerable ReadCollectionResponse(Stream stream, IEdmModel model) + { + ODataMessageWrapper message = new ODataMessageWrapper(stream); + ODataMessageReader messageReader = new ODataMessageReader(message as IODataResponseMessage, new ODataMessageReaderSettings(), model); + ODataDeserializerContext readContext = new ODataDeserializerContext() { Model = model }; + IEnumerable readEntities = _resourceSetDeserializer.Read(messageReader, typeof(T[]), readContext) as IEnumerable; + return readEntities.Cast(); + } + + private T ReadSingleResponse(Stream stream, IEdmModel model, ODataPath path) + { + ODataMessageWrapper message = new ODataMessageWrapper(stream); + ODataMessageReader messageReader = new ODataMessageReader(message as IODataResponseMessage, new ODataMessageReaderSettings(), model); + ODataDeserializerContext readContext = new ODataDeserializerContext() { + Path = path, + Model = model, + ResourceType = typeof(T) + }; + object readEntity = _resourceDeserializer.Read(messageReader, typeof(T), readContext); + return (T)readEntity; + } + + private T ReadPrimitiveResponse(Stream stream, IEdmModel model) + { + ODataMessageWrapper message = new ODataMessageWrapper(stream); + ODataMessageReader messageReader = new ODataMessageReader(message as IODataResponseMessage, new ODataMessageReaderSettings(), model); + ODataDeserializerContext readContext = new ODataDeserializerContext() { Model = model }; + object readValue = _primitiveDeserializer.Read(messageReader, typeof(T), readContext); + return (T)readValue; + } + } + + class EnableNestedPathsDatabase + { + public EnableNestedPathsDatabase() + { + var addresses = new List() + { + new EnableNestedPathsAddress { City = "Addr1" }, + new EnableNestedPathsAddress { City = "Addr2" }, + new EnableNestedPathsAddress { City = null } + }; + + Products = new List() + { + new EnableNestedPathsProduct() + { + Id = 1, + Name = "Prod1", + }, + new EnableNestedPathsProduct() + { + Id = 2, + Name = "Prod2" + }, + new EnableNestedPathsProduct() + { + Id = 3, + Name = "Prod3" + } + }; + + Customers = new List() + { + new EnableNestedPathsCustomer() + { + Id = 1, + Name = "Cust1", + Products = new List { Products[0], Products[1] }, + Emails = new List { "email1", "email2" }, + FavoriteProduct = Products[0], + HomeAddress = addresses[0], + Addresses = new List { addresses[0], addresses[1]} + }, + new EnableNestedPathsCustomer() + { + Id = 2, + Name = "Cust2", + Products = new List() { Products[1], Products[2] }, + Emails = new List(), + FavoriteProduct = null, + HomeAddress = null, + Addresses = null + }, + new EnableNestedPathsCustomer() + { + Id = 3, + Name = "Cust3", + Products = new List(), + Emails = new List(), + FavoriteProduct = null, + HomeAddress = addresses[2], + Addresses = new List { addresses[1], addresses[2] } + } + }; + } + + public IList Products { get; set; } + public IList Customers { get; set; } + } + + class EnableNestedPathsCustomerComparer : IEqualityComparer + { + public bool Equals(EnableNestedPathsCustomer x, EnableNestedPathsCustomer y) + { + return x.Name == y.Name && x.Id == y.Id; + } + + public int GetHashCode(EnableNestedPathsCustomer obj) + { + throw new NotImplementedException(); + } + } + + class EnableNestedPathsProductComparer : IEqualityComparer + { + public bool Equals(EnableNestedPathsProduct x, EnableNestedPathsProduct y) + { + return x.Name == y.Name && x.Id == y.Id; + } + + public int GetHashCode(EnableNestedPathsProduct obj) + { + throw new NotImplementedException(); + } + } + + class EnableNestedPathsCustomersController + { + readonly EnableNestedPathsDatabase _db = new EnableNestedPathsDatabase(); + + [EnableNestedPaths] + [EnableQuery] + public IQueryable Get() + { + return _db.Customers.AsQueryable(); + } + } + + class EnableNestedPathsTopCustomerController + { + readonly EnableNestedPathsDatabase _db = new EnableNestedPathsDatabase(); + + [EnableNestedPaths] + public SingleResult Get() + { + return new SingleResult(_db.Customers.Where(p => p.Id == 1).AsQueryable()); + } + } + + class EnableNestedPathsProductsController + { + readonly EnableNestedPathsDatabase _db = new EnableNestedPathsDatabase(); + + [EnableNestedPaths] + public IQueryable Get() + { + return _db.Products.AsQueryable(); + } + } + + class EnableNestedPathsTopProductController + { + readonly EnableNestedPathsDatabase _db = new EnableNestedPathsDatabase(); + + [EnableNestedPaths] + public SingleResult Get() + { + return new SingleResult(_db.Products.Where(p => p.Id == 1).AsQueryable()); + } + } + + class EnableNestedPathsCustomer + { + public int Id { get; set; } + public string Name { get; set; } + public IList Emails { get; set; } + public IList Products { get; set; } + public EnableNestedPathsProduct FavoriteProduct { get; set; } + public EnableNestedPathsAddress HomeAddress { get; set; } + public List Addresses { get; set; } + } + + class EnableNestedPathsVipCustomer : EnableNestedPathsCustomer + { + + } + + class EnableNestedPathsProduct + { + public int Id { get; set; } + public string Name { get; set; } + } + + class EnableNestedPathsAddress + { + public string City { get; set; } + } +} + +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnableQueryTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnableQueryTests.cs index 795d46b6c5..46a66ec72e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnableQueryTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnableQueryTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnumDeserializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnumDeserializerTest.cs index d7123089c8..ad94a0c249 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnumDeserializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnumDeserializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnumSerializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnumSerializerTest.cs index 9c89e276a9..9cc2def025 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnumSerializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/EnumSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/HttpContentExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/HttpContentExtensions.cs index 629e062455..4648faf99e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/HttpContentExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/HttpContentExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/IHeaderDictionaryExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/IHeaderDictionaryExtensions.cs index 3ea53e2d3b..01c626e87f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/IHeaderDictionaryExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/IHeaderDictionaryExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http.Headers; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/RoutingConfigurationExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/RoutingConfigurationExtensions.cs index d79642f41a..f05b3140ca 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/RoutingConfigurationExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Extensions/RoutingConfigurationExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using Microsoft.AspNetCore.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FastPropertyAccessorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FastPropertyAccessorTest.cs index 6b5b353e55..2ce3c65097 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FastPropertyAccessorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FastPropertyAccessorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData; using Xunit; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ClrTypeCacheTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ClrTypeCacheTest.cs index 060450c4bb..b9c005d53f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ClrTypeCacheTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ClrTypeCacheTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/CollectionsTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/CollectionsTests.cs index 9cab1e5db4..bc3afc7d1b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/CollectionsTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/CollectionsTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/DefaultODataETagHandlerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/DefaultODataETagHandlerTests.cs index 358039959e..ada7a3a42f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/DefaultODataETagHandlerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/DefaultODataETagHandlerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/CollectionDeserializationHelpersTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/CollectionDeserializationHelpersTest.cs index 3d7b6cdb44..02d566b9d5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/CollectionDeserializationHelpersTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/CollectionDeserializationHelpersTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/DefaultODataDeserializerProviderTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/DefaultODataDeserializerProviderTests.cs index 7d05d39bdf..ac9b0a4757 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/DefaultODataDeserializerProviderTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/DefaultODataDeserializerProviderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/DeserializationHelpersTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/DeserializationHelpersTest.cs index d349cb6aeb..25d0ce1d6c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/DeserializationHelpersTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/DeserializationHelpersTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -24,6 +28,7 @@ using Microsoft.OData.Edm; using Moq; using Xunit; +using Microsoft.AspNet.OData.Builder; namespace Microsoft.AspNet.OData.Test.Formatter.Deserialization { @@ -324,6 +329,66 @@ public void ApplyProperty_DoesNotIgnoreKeyProperty_WithInstanceAnnotation() resource.Verify(); } + + + [Fact] + public void ReadResource_DeletedResource_WithTransientTypeAndAnnotations() + { + // Arrange + ODataConventionModelBuilder builder = ODataConventionModelBuilderFactory.Create(); + builder.EntityType(); + builder.EnumType(); + IEdmModel model = builder.GetEdmModel(); + + IEdmEntityTypeReference customerTypeReference = model.GetEdmTypeReference(typeof(SimpleOpenCustomer)).AsEntity(); + ODataDeserializerProvider _deserializerProvider = ODataDeserializerProviderFactory.Create(); + var deserializer = new ODataResourceSetDeserializer(_deserializerProvider); + + var instAnn = new List(); + instAnn.Add(new ODataInstanceAnnotation("NS.Test2", new ODataPrimitiveValue(345))); + instAnn.Add(new ODataInstanceAnnotation("Core.ContentID", new ODataPrimitiveValue(1))); + + ODataResourceBase odataResource = new ODataDeletedResource + { + Properties = new[] + { + // declared properties + new ODataProperty { Name = "CustomerId", Value = 991 }, + new ODataProperty { Name = "Name", Value = "Name #991" }, + }, + TypeName = typeof(SimpleOpenCustomer).FullName, + + InstanceAnnotations = instAnn + }; + + ODataDeserializerContext readContext = new ODataDeserializerContext() + { + Model = model + }; + + ODataResourceWrapper topLevelResourceWrapper = new ODataResourceWrapper(odataResource); + var deletedEntity = new DeltaDeletedEntityObject(); + + // Act + DeserializationHelpers.ApplyInstanceAnnotations(deletedEntity, customerTypeReference, odataResource, _deserializerProvider, readContext); + + // Assert + + //Verify Instance Annotations + object value; + deletedEntity.TryGetPropertyValue("InstanceAnnotations", out value); + var persistentAnnotations = (value as IODataInstanceAnnotationContainer).GetResourceAnnotations(); + var transientAnnotations = deletedEntity.TransientInstanceAnnotationContainer.GetResourceAnnotations(); + + Assert.Single(persistentAnnotations); + Assert.Single(transientAnnotations); + + Assert.Equal("NS.Test2", persistentAnnotations.First().Key); + Assert.Equal("Core.ContentID", transientAnnotations.First().Key); + Assert.Equal(345, persistentAnnotations.First().Value); + Assert.Equal(1, transientAnnotations.First().Value); + } + [Fact] public void ApplyProperty_FailsWithUsefulErrorMessageOnUnknownProperty() { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/HttpRequestODataMessage.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/HttpRequestODataMessage.cs index 60c3741a96..c4c52aaea0 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/HttpRequestODataMessage.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/HttpRequestODataMessage.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/MockODataRequestMessage.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/MockODataRequestMessage.cs index acc1df4299..4bc60f365d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/MockODataRequestMessage.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/MockODataRequestMessage.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataActionPayloadDeserializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataActionPayloadDeserializerTest.cs index ce9aa00ca7..851262fda5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataActionPayloadDeserializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataActionPayloadDeserializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataCollectionDeserializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataCollectionDeserializerTests.cs index b8ecf48520..4d014a81f5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataCollectionDeserializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataCollectionDeserializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializationTestsCommon.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializationTestsCommon.cs index cd0208228d..7a127e8c9a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializationTestsCommon.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializationTestsCommon.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Net.Http.Headers; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializerContextTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializerContextTest.cs index 5f087de0f2..dc041c1878 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializerContextTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializerContextTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Formatter.Deserialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializerTest.cs index c04cb063f8..e0d739122a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataDeserializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Formatter.Deserialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEdmTypeDeserializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEdmTypeDeserializerTest.cs index bbcc068d3c..6a625917f1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEdmTypeDeserializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEdmTypeDeserializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Formatter.Deserialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEntityReferenceLinkDeserializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEntityReferenceLinkDeserializerTests.cs index c5c990805d..c62cd4e9fc 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEntityReferenceLinkDeserializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEntityReferenceLinkDeserializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; @@ -140,4 +144,4 @@ private class RelatedEntity { } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEnumDeserializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEnumDeserializerTests.cs index b676706af0..8f854935d0 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEnumDeserializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataEnumDeserializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Runtime.Serialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataMessageReaderLearningTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataMessageReaderLearningTests.cs index c10735b28a..4ee065ddc0 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataMessageReaderLearningTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataMessageReaderLearningTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.IO; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataPrimitiveDeserializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataPrimitiveDeserializerTests.cs index f900ac2e84..90f371ae42 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataPrimitiveDeserializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataPrimitiveDeserializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceDeserializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceDeserializerTests.cs index d32077c33b..e741e2f92a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceDeserializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceDeserializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -1033,7 +1037,7 @@ public void CreateResourceInstance_CreatesDeltaWith_ExpectedUpdatableProperties( Model = _readContext.Model, ResourceType = typeof(Delta) }; - var structuralProperties = _productEdmType.StructuralProperties().Select(p => p.Name); + var structuralProperties = _productEdmType.StructuralProperties().Select(p => p.Name).Union(_productEdmType.NavigationProperties().Select(p => p.Name)); // Act Delta resource = deserializer.CreateResourceInstance(_productEdmType, readContext) as Delta; @@ -1155,6 +1159,7 @@ public void ApplyNestedProperty_ThrowsArgumentNull_EntityResource() "resource"); } + [Fact] public void ApplyNestedProperty_ThrowsODataException_NavigationPropertyNotfound() { @@ -1168,35 +1173,6 @@ public void ApplyNestedProperty_ThrowsODataException_NavigationPropertyNotfound( "Cannot find nested property 'SomeProperty' on the resource type 'ODataDemo.Product'."); } - [Fact] - public void ApplyNestedProperty_ThrowsODataException_WhenPatchingNavigationProperty() - { - // Arrange - var deserializer = new ODataResourceDeserializer(_deserializerProvider); - ODataNestedResourceInfoWrapper resourceInfoWrapper = new ODataNestedResourceInfoWrapper(new ODataNestedResourceInfo { Name = "Supplier" }); - resourceInfoWrapper.NestedItems.Add(new ODataResourceWrapper(new ODataResource())); - _readContext.ResourceType = typeof(Delta); - - // Act & Assert - ExceptionAssert.Throws( - () => deserializer.ApplyNestedProperty(42, resourceInfoWrapper, _productEdmType, _readContext), - "Cannot apply PATCH to navigation property 'Supplier' on entity type 'ODataDemo.Product'."); - } - - [Fact] - public void ApplyNestedProperty_ThrowsODataException_WhenPatchingCollectionNavigationProperty() - { - // Arrange - var deserializer = new ODataResourceDeserializer(_deserializerProvider); - ODataNestedResourceInfoWrapper resourceInfoWrapper = new ODataNestedResourceInfoWrapper(new ODataNestedResourceInfo { Name = "Products" }); - resourceInfoWrapper.NestedItems.Add(new ODataResourceSetWrapper(new ODataResourceSet())); - _readContext.ResourceType = typeof(Delta); - - // Act & Assert - ExceptionAssert.Throws( - () => deserializer.ApplyNestedProperty(42, resourceInfoWrapper, _supplierEdmType, _readContext), - "Cannot apply PATCH to navigation property 'Products' on entity type 'ODataDemo.Supplier'."); - } [Fact] public void ApplyNestedProperty_UsesThePropertyAlias_ForResourceSet() diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceSetDeserializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceSetDeserializerTest.cs index 05de466e51..22756615fd 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceSetDeserializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataResourceSetDeserializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -62,7 +66,7 @@ public void ReadInline_Throws_ArgumentMustBeOfType() ExceptionAssert.ThrowsArgument( () => deserializer.ReadInline(item: 42, edmType: _customersType, readContext: new ODataDeserializerContext()), "item", - "The argument must be of type 'ODataResourceSetWrapper'."); + "The argument must be of type 'ODataResourceSetWrapperBase'."); } [Fact] @@ -85,7 +89,7 @@ public void ReadInline_Calls_ReadFeed() deserializer.Verify(); Assert.Same(expectedResult, result); } - + [Fact] public void ReadFeed_Throws_TypeCannotBeDeserialized() { @@ -125,6 +129,59 @@ public void ReadFeed_Calls_ReadInlineForEachEntry() entityDeserializer.Verify(); } + [Fact] + public void ReadResourceSet_Calls_ReadInlineForDeltaFeeds() + { + // Arrange + Mock deserializerProvider = new Mock(); + Mock entityDeserializer = new Mock(ODataPayloadKind.Resource); + ODataResourceSetDeserializer deserializer = new ODataResourceSetDeserializer(deserializerProvider.Object); + ODataDeltaResourceSetWrapper resourceSetWrapper = new ODataDeltaResourceSetWrapper(new ODataDeltaResourceSet()); + resourceSetWrapper.Resources.Add(new ODataResourceWrapper(new ODataResource { Id = new Uri("http://a1/") })); + resourceSetWrapper.Resources.Add(new ODataResourceWrapper(new ODataResource { Id = new Uri("http://a2/") })); + ODataDeserializerContext readContext = new ODataDeserializerContext { Model = _model }; + + deserializerProvider.Setup(p => p.GetEdmTypeDeserializer(_customerType)).Returns(entityDeserializer.Object); + entityDeserializer.Setup(d => d.ReadInline(resourceSetWrapper.Resources[0], _customerType, readContext)).Returns("entry1").Verifiable(); + entityDeserializer.Setup(d => d.ReadInline(resourceSetWrapper.Resources[1], _customerType, readContext)).Returns("entry2").Verifiable(); + + + // Act + var result = deserializer.ReadResourceSet(resourceSetWrapper, _customerType, readContext).Cast().ToList(); + + // Assert + Assert.Equal(new[] { "entry1", "entry2" }, result.OfType()); + entityDeserializer.Verify(); + + } + + [Fact] + public void ReadResourceSet_Calls_ReadInlineForDeltaFeeds_WithDeletes() + { + // Arrange + Mock deserializerProvider = new Mock(); + Mock entityDeserializer = new Mock(ODataPayloadKind.Resource); + ODataResourceSetDeserializer deserializer = new ODataResourceSetDeserializer(deserializerProvider.Object); + ODataDeltaResourceSetWrapper resourceSetWrapper = new ODataDeltaResourceSetWrapper(new ODataDeltaResourceSet()); + resourceSetWrapper.Resources.Add(new ODataResourceWrapper(new ODataResource { Id = new Uri("http://a1/") })); + resourceSetWrapper.Resources.Add(new ODataResourceWrapper(new ODataResource { Id = new Uri("http://a2/") })); + resourceSetWrapper.Resources.Add(new ODataResourceWrapper(new ODataDeletedResource {TypeName=typeof(Customer).FullName, Reason= DeltaDeletedEntryReason.Deleted, Id = new Uri("http://a2/"), Properties = new List() })); + + ODataDeserializerContext readContext = new ODataDeserializerContext { Model = _model }; + + deserializerProvider.Setup(p => p.GetEdmTypeDeserializer(_customerType)).Returns(entityDeserializer.Object); + entityDeserializer.Setup(d => d.ReadInline(resourceSetWrapper.Resources[0], _customerType, readContext)).Returns("entry1").Verifiable(); + entityDeserializer.Setup(d => d.ReadInline(resourceSetWrapper.Resources[1], _customerType, readContext)).Returns("entry2").Verifiable(); + entityDeserializer.Setup(d => d.ReadInline(resourceSetWrapper.Resources[2], _customerType, readContext)).Returns("entry3").Verifiable(); + + // Act + var result = deserializer.ReadResourceSet(resourceSetWrapper, _customerType, readContext).Cast().ToList(); + + // Assert + Assert.Equal(new[] { "entry1", "entry2", "entry3" }, result.OfType()); + entityDeserializer.Verify(); + } + [Fact] public async Task Read_ReturnsEdmComplexObjectCollection_TypelessMode() { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataSingletonDeserializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataSingletonDeserializerTest.cs index 22a3936379..dac8e3692d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataSingletonDeserializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Deserialization/ODataSingletonDeserializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Net.Http.Headers; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ETagOfTEntityTypeTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ETagOfTEntityTypeTests.cs index e8dede8798..05f34b1e80 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ETagOfTEntityTypeTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ETagOfTEntityTypeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ETagTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ETagTests.cs index d45255f9ca..eaefce6383 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ETagTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ETagTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/EdmLibHelpersTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/EdmLibHelpersTests.cs index 5bd5f726b4..c4287d2a2d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/EdmLibHelpersTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/EdmLibHelpersTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/EdmPrimitiveHelpersTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/EdmPrimitiveHelpersTest.cs index 0d4327700e..49f59c063d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/EdmPrimitiveHelpersTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/EdmPrimitiveHelpersTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.ComponentModel.DataAnnotations; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/InheritanceTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/InheritanceTests.cs index 374a4a8af1..0264b1d019 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/InheritanceTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/InheritanceTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/JsonAssert.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/JsonAssert.cs index 289890add7..92e54e7f2b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/JsonAssert.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/JsonAssert.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Newtonsoft.Json.Linq; using Xunit; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/NullCollectionsTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/NullCollectionsTests.cs index e2201c4b8f..6ac78e6551 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/NullCollectionsTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/NullCollectionsTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataActionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataActionTests.cs index 6325948fca..74d09a1df5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataActionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataActionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataEntityReferenceLinkTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataEntityReferenceLinkTests.cs new file mode 100644 index 0000000000..1d6ec7cf06 --- /dev/null +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataEntityReferenceLinkTests.cs @@ -0,0 +1,181 @@ +// Copyright (c) Microsoft Corporation. All rights reserved. +// Licensed under the MIT License. See License.txt in the project root for license information. + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Formatter; +using Microsoft.AspNet.OData.Formatter.Deserialization; +using Microsoft.AspNet.OData.Test.Abstraction; +using Microsoft.OData; +using Microsoft.OData.Edm; +using Microsoft.OData.UriParser; +using Xunit; +using ODataPath = Microsoft.AspNet.OData.Routing.ODataPath; + +namespace Microsoft.AspNet.OData.Test.Formatter +{ + public class ODataEntityReferenceLinkTests + { + private readonly ODataDeserializerProvider _deserializerProvider; + public ODataEntityReferenceLinkTests() + { + _deserializerProvider = ODataDeserializerProviderFactory.Create(); + } + + /// + /// In OData v4.0 an ODataEntityReferenceLink will be converted + /// to a resource then deserialized as a resource. + /// + [Fact] + public void ReadResource_CanRead_AnEntityRefenceLink() + { + // Arrange + ODataConventionModelBuilder builder = ODataConventionModelBuilderFactory.Create(); + var books = builder.EntitySet("Books"); + builder.EntityType(); + builder.EntitySet("Authors"); + var author = + books.EntityType.HasOptional((e) => e.Author); + books.HasNavigationPropertyLink(author, (a, b) => new Uri("aa:b"), false); + books.HasOptionalBinding((e) => e.Author, "authorr"); + + + IEdmModel model = builder.GetEdmModel(); + IEdmEntityTypeReference bookTypeReference = model.GetEdmTypeReference(typeof(Book)).AsEntity(); + var deserializer = new ODataResourceDeserializer(_deserializerProvider); + ODataResource odataResource = new ODataResource + { + Properties = new[] + { + new ODataProperty { Name = "Id", Value = 1}, + new ODataProperty { Name = "Name", Value = "BookA"}, + }, + TypeName = "Microsoft.AspNet.OData.Test.Formatter.Book" + }; + + IEdmEntitySet entitySet = model.EntityContainer.FindEntitySet("Books"); + ODataPath path = new ODataPath(new EntitySetSegment(entitySet)); + var request = RequestFactory.CreateFromModel(model, path: path); + + ODataDeserializerContext readContext = new ODataDeserializerContext() + { + Model = model, + Request = request, + Path = path + }; + + ODataResourceWrapper topLevelResourceWrapper = new ODataResourceWrapper(odataResource); + ODataNestedResourceInfo resourceInfo = new ODataNestedResourceInfo + { + IsCollection = false, + Name = "Author" + }; + + ODataEntityReferenceLink refLink = new ODataEntityReferenceLink { Url = new Uri("http://localhost/Authors(2)") }; + ODataEntityReferenceLinkBase refLinkWrapper = new ODataEntityReferenceLinkBase(refLink); + + ODataNestedResourceInfoWrapper resourceInfoWrapper = new ODataNestedResourceInfoWrapper(resourceInfo); + resourceInfoWrapper.NestedItems.Add(refLinkWrapper); + topLevelResourceWrapper.NestedResourceInfos.Add(resourceInfoWrapper); + + // Act + Book book = deserializer.ReadResource(topLevelResourceWrapper, bookTypeReference, readContext) + as Book; + + // Assert + Assert.NotNull(book); + Assert.Equal(2, book.Author.Id); + Assert.NotNull(book.Author); + + } + + [Fact] + public void ReadResource_CanRead_ACollectionOfEntityRefenceLinks() + { + // Arrange + ODataConventionModelBuilder builder = ODataConventionModelBuilderFactory.Create(); + var books = builder.EntitySet("Books"); + builder.EntityType(); + builder.EntitySet("Authors"); + var author = + books.EntityType.HasOptional((e) => e.Author); + books.HasNavigationPropertyLink(author, (a, b) => new Uri("aa:b"), false); + books.HasOptionalBinding((e) => e.Author, "authorr"); + + + IEdmModel model = builder.GetEdmModel(); + IEdmEntityTypeReference bookTypeReference = model.GetEdmTypeReference(typeof(Book)).AsEntity(); + var deserializer = new ODataResourceDeserializer(_deserializerProvider); + ODataResource odataResource = new ODataResource + { + Properties = new[] + { + new ODataProperty { Name = "Id", Value = 1}, + new ODataProperty { Name = "Name", Value = "BookA"}, + }, + TypeName = "Microsoft.AspNet.OData.Test.Formatter.Book" + }; + + IEdmEntitySet entitySet = model.EntityContainer.FindEntitySet("Books"); + ODataPath path = new ODataPath(new EntitySetSegment(entitySet)); + var request = RequestFactory.CreateFromModel(model, path: path); + + ODataDeserializerContext readContext = new ODataDeserializerContext() + { + Model = model, + Request = request, + Path = path + }; + + ODataResourceWrapper topLevelResourceWrapper = new ODataResourceWrapper(odataResource); + ODataNestedResourceInfo resourceInfo = new ODataNestedResourceInfo + { + IsCollection = true, + Name = "AuthorList" + }; + + IList refLinks = new List() + { + new ODataEntityReferenceLinkBase(new ODataEntityReferenceLink{ Url = new Uri("http://localhost/Authors(2)") }), + new ODataEntityReferenceLinkBase(new ODataEntityReferenceLink{ Url = new Uri("http://localhost/Authors(3)")}) + }; + + + ODataNestedResourceInfoWrapper resourceInfoWrapper = new ODataNestedResourceInfoWrapper(resourceInfo); + + foreach (ODataEntityReferenceLinkBase refLinkWrapper in refLinks) + { + resourceInfoWrapper.NestedItems.Add(refLinkWrapper); + } + topLevelResourceWrapper.NestedResourceInfos.Add(resourceInfoWrapper); + + // Act + Book book = deserializer.ReadResource(topLevelResourceWrapper, bookTypeReference, readContext) + as Book; + + // Assert + Assert.NotNull(book); + Assert.NotNull(book.AuthorList); + Assert.Equal(2, book.AuthorList.Count()); + } + + public class Book + { + [Key] + public int Id { get; set; } + public string Name { get; set; } + public Author Author { get; set; } + public IList AuthorList { get; set; } + } + + public class Author + { + [Key] + public int Id { get; set; } + public string Name { get; set; } + } + } +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFormatterTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFormatterTests.cs index c0186a74d4..94569be77f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFormatterTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFormatterTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFunctionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFunctionTests.cs index 31bb997b04..4c804cfd9c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFunctionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataFunctionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypeFormatterTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypeFormatterTests.cs index 8cfa1b3b4c..fec807d1e2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypeFormatterTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypeFormatterTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypeFormattersTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypeFormattersTests.cs index fcffc4865d..5842ef1b44 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypeFormattersTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypeFormattersTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypesTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypesTest.cs index 209c043102..99be89e5c9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypesTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMediaTypesTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMessageWrapperTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMessageWrapperTest.cs index 528b24a862..3021fbdfa9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMessageWrapperTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataMessageWrapperTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -60,4 +64,4 @@ public void ResolveUrl_ResolvesUriWithContentId() Assert.Equal("http://localhost/values(1)", uri.OriginalString); } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataModelBinderConverterTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataModelBinderConverterTests.cs index 59630ab43c..03f4bda54d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataModelBinderConverterTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataModelBinderConverterTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Formatter; @@ -51,4 +55,4 @@ public void Convert_CheckPrimitives(object odataValue, EdmPrimitiveTypeKind edmT Assert.Equal(expectedResult, result); } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataModelBinderProviderTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataModelBinderProviderTest.cs index dead8ee9d2..8879e36b25 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataModelBinderProviderTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataModelBinderProviderTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -46,6 +50,7 @@ public ODataModelBinderProviderTest() _configuration.Routes.MapHttpRoute("default", "{controller}/{action}({id})"); _server = new HttpServer(_configuration); + _client = new HttpClient(_server); } diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataRawValueMediaTypeMappingTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataRawValueMediaTypeMappingTests.cs index 08ce9b7f18..f3a83a6392 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataRawValueMediaTypeMappingTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataRawValueMediaTypeMappingTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataTestUtil.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataTestUtil.cs index 20e3794930..3c31cd5f80 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataTestUtil.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataTestUtil.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataValueExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataValueExtensionsTest.cs index 866795164c..a8ec6dfb39 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataValueExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/ODataValueExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Formatter; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PeopleController.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PeopleController.cs index 18a9a97149..fa3dc3f391 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PeopleController.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PeopleController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PresidentController.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PresidentController.cs index d7f601f43d..8c3d9ff3ac 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PresidentController.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PresidentController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PrimitiveTypesTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PrimitiveTypesTest.cs index ac4d9ea274..461d36779e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PrimitiveTypesTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/PrimitiveTypesTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/CollectionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/CollectionTest.cs index a407d26a9e..68dfde36e9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/CollectionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/CollectionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ComplexTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ComplexTypeTest.cs index 8d458cbc22..4a94b0c11e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ComplexTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ComplexTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Threading.Tasks; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/DefaultODataSerializerProviderTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/DefaultODataSerializerProviderTests.cs index 5ab0843102..b26b13886a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/DefaultODataSerializerProviderTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/DefaultODataSerializerProviderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EdmDirectValueAnnotationsManagerExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EdmDirectValueAnnotationsManagerExtensions.cs index 3be19652b8..d049aa2667 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EdmDirectValueAnnotationsManagerExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EdmDirectValueAnnotationsManagerExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; @@ -68,4 +72,4 @@ public EdmValueKind ValueKind } } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EdmEntityObjectTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EdmEntityObjectTest.cs index f75fa9676c..e0529d8b7e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EdmEntityObjectTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EdmEntityObjectTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EntityTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EntityTypeTest.cs index 3e38ee6205..bf330f3c7a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EntityTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/EntityTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Threading.Tasks; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Address.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Address.cs index 7d63ef726e..bb60aa2ca2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Address.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Address.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Customer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Customer.cs index 970ee256e2..fb6882f311 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Customer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Customer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Order.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Order.cs index 7ca7568af8..4e59074011 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Order.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/Models/Order.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataCollectionSerializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataCollectionSerializerTests.cs index f77677d3a8..9335568a48 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataCollectionSerializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataCollectionSerializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataDeltaFeedSerializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataDeltaFeedSerializerTests.cs index 4dc60f1ae7..3c4ff74d84 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataDeltaFeedSerializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataDeltaFeedSerializerTests.cs @@ -1,8 +1,13 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; +using System.Collections.Generic; using System.IO; using System.Runtime.Serialization; using Microsoft.AspNet.OData.Formatter; @@ -271,6 +276,7 @@ public void WriteDeltaFeedInline_Can_WriteCollectionOfIEdmChangedObjects() serializerProvider.Setup(s => s.GetEdmTypeSerializer(edmType)).Returns(customerSerializer.Object); ODataDeltaFeedSerializer serializer = new ODataDeltaFeedSerializer(serializerProvider.Object); + _writeContext.Type = typeof(IEdmObject); // Act serializer.WriteDeltaFeedInline(new[] { edmObject.Object }, feedType, mockWriter.Object, _writeContext); @@ -288,6 +294,7 @@ public void WriteDeltaFeedInline_WritesEachEntityInstance() var mockWriter = new Mock(); customerSerializer.Setup(s => s.WriteDeltaObjectInline(_deltaFeedCustomers[0], _customersType.ElementType(), mockWriter.Object, _writeContext)).Verifiable(); _serializer = new ODataDeltaFeedSerializer(provider); + _writeContext.Type = typeof(IEdmObject); // Act _serializer.WriteDeltaFeedInline(_deltaFeedCustomers, _customersType, mockWriter.Object, _writeContext); @@ -350,6 +357,33 @@ public void WriteDeltaFeedInline_Sets_DeltaLink() mockWriter.Verify(); } + [Fact] + public void WriteDeltaFeedInline_Sets_DeltaResource_WithAnnotations() + { + // Arrange + IEnumerable instance = new object[0]; + ODataDeltaResourceSet deltafeed = new ODataDeltaResourceSet { DeltaLink = new Uri("http://deltalink.com/"), InstanceAnnotations=new List() { new ODataInstanceAnnotation("NS.Test",new ODataPrimitiveValue( 1)) } }; + Mock serializer = new Mock(_serializerProvider); + serializer.CallBase = true; + serializer.Setup(s => s.CreateODataDeltaFeed(instance, _customersType, _writeContext)).Returns(deltafeed); + var mockWriter = new Mock(); + + mockWriter.Setup(m => m.WriteStart(deltafeed)); + mockWriter + .Setup(m => m.WriteEnd()) + .Callback(() => + { + Assert.Equal("http://deltalink.com/", deltafeed.DeltaLink.AbsoluteUri); + }) + .Verifiable(); + + // Act + serializer.Object.WriteDeltaFeedInline(instance, _customersType, mockWriter.Object, _writeContext); + + // Assert + mockWriter.Verify(); + } + [Fact] public void CreateODataDeltaFeed_Sets_CountValueForPageResult() { @@ -384,4 +418,4 @@ public void CreateODataDeltaFeed_Sets_NextPageLinkForPageResult() Assert.Equal(expectedNextLink, feed.NextPageLink); } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEdmTypeSerializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEdmTypeSerializerTest.cs index be742e4e66..db5c1927a6 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEdmTypeSerializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEdmTypeSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Formatter.Serialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEntityReferenceLinkSerializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEntityReferenceLinkSerializerTest.cs index a97057caa6..0f3cc36277 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEntityReferenceLinkSerializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEntityReferenceLinkSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEntityReferenceLinksSerializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEntityReferenceLinksSerializerTest.cs index 9a3c76f852..af9dab6189 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEntityReferenceLinksSerializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEntityReferenceLinksSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEnumTypeSerializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEnumTypeSerializerTests.cs index 3f76aefae6..b3abd174d1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEnumTypeSerializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataEnumTypeSerializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Formatter; using Microsoft.AspNet.OData.Formatter.Serialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataErrorSerializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataErrorSerializerTest.cs index 3f1a51668a..07625ac382 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataErrorSerializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataErrorSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.IO; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataMessageWriterLearningTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataMessageWriterLearningTests.cs index f7bb4b84db..1d839eaf88 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataMessageWriterLearningTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataMessageWriterLearningTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataMetadataSerializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataMetadataSerializerTest.cs index fdd6d267ca..78f7ae64a0 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataMetadataSerializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataMetadataSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataPayloadKindHelperTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataPayloadKindHelperTests.cs index bfc6a677f3..1930323c03 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataPayloadKindHelperTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataPayloadKindHelperTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Formatter.Serialization; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataPrimitiveSerializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataPrimitiveSerializerTests.cs index c002bb1e9b..f2a740d043 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataPrimitiveSerializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataPrimitiveSerializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataRawValueSerializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataRawValueSerializerTests.cs index c7d5e5ffe7..7621a448e1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataRawValueSerializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataRawValueSerializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; @@ -142,4 +146,4 @@ public void SerializesReturnedCountValue() Assert.Equal("5", result); } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataResourceSerializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataResourceSerializerTests.cs index 584e527ade..95e11b825d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataResourceSerializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataResourceSerializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataResourceSetSerializerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataResourceSetSerializerTests.cs index 9dce63839b..18b7d686c4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataResourceSetSerializerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataResourceSetSerializerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSerializerContextTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSerializerContextTest.cs index d2d22b6fdc..d02ea00fb8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSerializerContextTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSerializerContextTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSerializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSerializerTest.cs index a0b4683f00..6e9dc05f63 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSerializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Formatter.Serialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataServiceDocumentSerializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataServiceDocumentSerializerTest.cs index 37b6cb073b..e020dffadc 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataServiceDocumentSerializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataServiceDocumentSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSingletonSerializerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSingletonSerializerTest.cs index 0512a38e56..60cd0fba0a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSingletonSerializerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ODataSingletonSerializerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ResourceSetTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ResourceSetTest.cs index 8124f5697e..ebed231651 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ResourceSetTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/ResourceSetTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Collections.ObjectModel; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/SelectExpandNodeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/SelectExpandNodeTest.cs index 4c64c2f48f..f426574858 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/SelectExpandNodeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/SelectExpandNodeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/SerializationTestsHelpers.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/SerializationTestsHelpers.cs index 0741faf69e..f41d386b1d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/SerializationTestsHelpers.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/SerializationTestsHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/TestODataMetadataLevel.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/TestODataMetadataLevel.cs index 52956fe9ad..fc8e9bf163 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/TestODataMetadataLevel.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Formatter/Serialization/TestODataMetadataLevel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Formatter.Serialization { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FromODataUriTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FromODataUriTest.cs index 3e23c59288..259c995e19 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FromODataUriTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FromODataUriTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FunctionActionAdvertisedTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FunctionActionAdvertisedTest.cs index be54b21adf..5ca79d25e2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FunctionActionAdvertisedTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/FunctionActionAdvertisedTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpConfigurationExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpConfigurationExtensions.cs index 44eddecc28..bb4e6607cc 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpConfigurationExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpConfigurationExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Web.Http; @@ -16,4 +20,4 @@ public static void MapODataServiceRoute(this HttpConfiguration configuration, IE } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpConfigurationExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpConfigurationExtensionsTest.cs index d645b5287b..c888fe175c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpConfigurationExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpConfigurationExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -429,4 +433,4 @@ private class TestService : ITestService { } private class TestService2 : ITestService { } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpErrorExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpErrorExtensionsTest.cs index 9600d7a8e7..97de2e523d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpErrorExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpErrorExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -86,4 +90,4 @@ public void CreateODataError_CopiesModelStateErrorsToInnerError() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpRequestMessageExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpRequestMessageExtensionsTest.cs index 872ac19e4a..4fd39d2429 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpRequestMessageExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpRequestMessageExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -422,4 +426,4 @@ public void RequestContainer_Throws_WhenRouteNameIsNotSet() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpRouteCollectionExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpRouteCollectionExtensionsTest.cs index 04dad3ed4e..dc61d3f130 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpRouteCollectionExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/HttpRouteCollectionExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Collections.Generic; @@ -217,4 +221,4 @@ public IHttpActionResult Get(int ID) } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/MetadataControllerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/MetadataControllerTest.cs index 72ebc335e7..8bab9709c9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/MetadataControllerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/MetadataControllerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Microsoft.AspNet.OData.Test.Shared.projitems b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Microsoft.AspNet.OData.Test.Shared.projitems index 1d970dc204..466cff1d0a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Microsoft.AspNet.OData.Test.Shared.projitems +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Microsoft.AspNet.OData.Test.Shared.projitems @@ -146,6 +146,8 @@ + + @@ -167,6 +169,7 @@ + @@ -242,6 +245,7 @@ + @@ -289,6 +293,7 @@ + diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/NullEdmComplexObjectTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/NullEdmComplexObjectTest.cs index 7826540c6e..a8cab2bf77 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/NullEdmComplexObjectTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/NullEdmComplexObjectTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataActionParametersTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataActionParametersTest.cs index 4ac2535909..a4caf94386 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataActionParametersTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataActionParametersTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Runtime.Serialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataContainmentTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataContainmentTest.cs index 9f6aa3c257..652afcd292 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataContainmentTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataContainmentTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Linq; @@ -593,4 +597,4 @@ public IQueryable TopOrder() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataFormattingAttributeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataFormattingAttributeTest.cs index 3291150d60..4839ae66e2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataFormattingAttributeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataFormattingAttributeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Collections.Generic; @@ -91,4 +95,4 @@ public TestODataMediaTypeFormatter() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataNullValueMessageHandlerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataNullValueMessageHandlerTest.cs index 9e12d6005d..859847ca01 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataNullValueMessageHandlerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataNullValueMessageHandlerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataPathHandlerExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataPathHandlerExtensions.cs index 3a20b5e5c7..1acc27e3f5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataPathHandlerExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataPathHandlerExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics.Contracts; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataRoutingAttributeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataRoutingAttributeTest.cs index a8fd334459..c07418875e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataRoutingAttributeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataRoutingAttributeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETFX // ODataRoutingAttribute is only used in AspNet using System.Web.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSingletonTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSingletonTest.cs index b2bf1a70ee..b6bcad9a25 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSingletonTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSingletonTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataStreamPropertyTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataStreamPropertyTest.cs index af1d6d4229..05b0819ad1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataStreamPropertyTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataStreamPropertyTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSwaggerConverterTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSwaggerConverterTest.cs index f74ae7c288..b901027fac 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSwaggerConverterTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSwaggerConverterTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Abstraction; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSwaggerUtilitiesTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSwaggerUtilitiesTest.cs index ac9ab4b2e2..b49f748f15 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSwaggerUtilitiesTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataSwaggerUtilitiesTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataUriResolverExtensionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataUriResolverExtensionTest.cs index 86bd2889e7..e87f3769e4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataUriResolverExtensionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ODataUriResolverExtensionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -421,4 +425,4 @@ public class ParserExtenstionOrder public decimal Price { get; set; } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/OpenComplexTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/OpenComplexTypeTest.cs index ea1770d855..358725872c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/OpenComplexTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/OpenComplexTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/OpenEntityTypeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/OpenEntityTypeTest.cs index bc63b90c73..ce4d0b1a3f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/OpenEntityTypeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/OpenEntityTypeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PageResultOfTTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PageResultOfTTest.cs index cc80e4d266..3abfe213ea 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PageResultOfTTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PageResultOfTTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -56,4 +60,4 @@ public void Ctor_Throws_OnNegativeCount() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestActionValueBinderTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestActionValueBinderTest.cs index f74f91b73b..e0f2cea82a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestActionValueBinderTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestActionValueBinderTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Linq; @@ -69,4 +73,4 @@ public void Post(Customer customer) } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestContentNegotiatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestContentNegotiatorTest.cs index 73786452de..4deae931a0 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestContentNegotiatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestContentNegotiatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System.Collections.Generic; @@ -40,4 +44,4 @@ public void Negotiate_CallGetPerRequestFormatterInstanceFirst() } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestParameterBindingTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestParameterBindingTest.cs index a31cccc247..c67abbe472 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestParameterBindingTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PerRequestParameterBindingTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; @@ -104,4 +108,4 @@ protected override HttpParameterBinding CreateInnerBinding(IEnumerable +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PublicApi/PublicApiTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PublicApi/PublicApiTest.cs index 9ca4ac572b..2f28cfec1c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PublicApi/PublicApiTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/PublicApi/PublicApiTest.cs @@ -1,8 +1,13 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; +using System.Linq; using Microsoft.AspNet.OData.Common; using Xunit; @@ -31,12 +36,25 @@ public void TestPublicApi() string baselineString = GetBaseLineString(); // Assert - Assert.True(String.Compare(baselineString, outputString, StringComparison.Ordinal) == 0, - String.Format("Base line file {1} and output file {2} do not match, please check.{0}" + - "To update the baseline, please run:{0}{0}" + - "copy /y \"{2}\" \"{1}\"", Environment.NewLine, - BaseLineFileFolder + BaseLineFileName, - outputFile)); + if (string.Compare(baselineString, outputString, StringComparison.Ordinal) != 0) + { + const int sliceSize = 128; + + var diffPoint = baselineString.Zip(outputString, (c1, c2) => c1 == c2).TakeWhile(b => b).Count(); + + var displayBaseline = baselineString.SliceCenter(diffPoint, sliceSize); + var displayOutput = outputString.SliceCenter(diffPoint, sliceSize); + + Assert.True(false, + string.Format("Base line file {1} and output file {2} do not match, please check.{0}" + + "Baseline:{0}\"{3}\"{0}" + + "Output: {0}\"{4}\"{0}{0}" + + "To update the baseline, please run:{0}{0}" + + "copy /y \"{2}\" \"{1}\"", Environment.NewLine, + BaseLineFileFolder + BaseLineFileName, + outputFile, + displayBaseline, displayOutput)); + } } private string GetBaseLineString() @@ -61,4 +79,36 @@ private string GetBaseLineString() } } } + + static class TestStringExtensions + { + internal static string SliceCenter(this string text, int center, int width) + { + int start; + + if (center < 0) + { + start = 0; + return string.Empty; + } + + center = (center <= text.Length) ? center : text.Length; + + start = center - (width / 2); + var length = width; + + if (start < 0) + { + start = 0; + length = center + (width / 2); + } + + if (start + length > text.Length) + { + length = text.Length - start; + } + + return text.Substring(start, length); + } + } } diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedArithmeticOperatorsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedArithmeticOperatorsTest.cs index a99a3541fe..a6ec5c4265 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedArithmeticOperatorsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedArithmeticOperatorsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Query; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedFunctionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedFunctionsTest.cs index fffff7f933..cc8792ed5d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedFunctionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedFunctionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedLogicalOperatorsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedLogicalOperatorsTest.cs index 9afa2c836f..a7bf179ed5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedLogicalOperatorsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedLogicalOperatorsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Query; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedQueryOptionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedQueryOptionsTest.cs index d84a1e6549..41624ac964 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedQueryOptionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/AllowedQueryOptionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Query; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ApplyQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ApplyQueryOptionTest.cs index 78f8e560af..f9d881999f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ApplyQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ApplyQueryOptionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Controllers/CustomerControllers.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Controllers/CustomerControllers.cs index f86ee7b4e1..ce2b348a83 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Controllers/CustomerControllers.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Controllers/CustomerControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Controllers/PrimitiveController.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Controllers/PrimitiveController.cs index 33bf862776..f9691b381c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Controllers/PrimitiveController.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Controllers/PrimitiveController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/CountQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/CountQueryOptionTest.cs index 3273e57318..68a126f86e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/CountQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/CountQueryOptionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/DefaultSkipTokenHandlerTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/DefaultSkipTokenHandlerTests.cs index b86ccf206d..5873f00b70 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/DefaultSkipTokenHandlerTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/DefaultSkipTokenHandlerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/EnableQueryAttributeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/EnableQueryAttributeTest.cs index ea89e510b6..2b346e921a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/EnableQueryAttributeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/EnableQueryAttributeTest.cs @@ -1,13 +1,30 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE +using System; using System.Collections.Generic; using System.Collections.ObjectModel; +using System.Linq; +using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNet.OData.Query; +using Microsoft.AspNet.OData.Routing; +using Microsoft.AspNet.OData.Test.Abstraction; using Microsoft.AspNet.OData.Test.Common; using Microsoft.AspNet.OData.Test.Common.Models; using Microsoft.AspNet.OData.Test.Query.Controllers; +using Microsoft.AspNetCore.Http; +using Microsoft.AspNetCore.Mvc; +using Microsoft.AspNetCore.Mvc.Abstractions; +using Microsoft.AspNetCore.Mvc.Filters; +using Microsoft.AspNetCore.Routing; +using Microsoft.Extensions.DependencyInjection; +using Microsoft.OData; +using Microsoft.OData.Edm; using Xunit; #else using System; @@ -254,8 +271,70 @@ public void OnActionExecuted_Throws_Null_Context() { ExceptionAssert.ThrowsArgumentNull(() => new EnableQueryAttribute().OnActionExecuted(null), "actionExecutedContext"); } - #if NETCORE // Following functionality is only supported in NetCore. + [Fact] + public void OnActionExecuted_HandlesStatusCodesCorrectly() + { + // Arrange + HttpContext httpContext = new DefaultHttpContext(); + httpContext.Request.Method = "Get"; + ActionDescriptor actionDescriptor = new ActionDescriptor(); + ActionContext actionContext = new ActionContext(httpContext, new RouteData(), actionDescriptor); + + ActionExecutedContext context = new ActionExecutedContext(actionContext, new List(), "someController"); + context.Result = new ObjectResult(new { Error = "Error", Message = "Message" }) { StatusCode = 500 }; + + EnableQueryAttribute attribute = new EnableQueryAttribute(); + + // Act and Assert + ExceptionAssert.DoesNotThrow(() => attribute.OnActionExecuted(context)); + } + + [Fact] + public void OnActionExecuted_HandlesRequestsNormally() + { + // Arrange + var routeName = "odata"; + IEdmModel model = new CustomersModelWithInheritance().Model; + var configuration = RoutingConfigurationFactory.Create(); + + configuration.Filter(); + + var request = RequestFactory.CreateFromModel(model, "http://localhost/odata/Customers?$filter=Id eq 1", routeName, new ODataPath()); + + IServiceProvider serviceProvider = GetServiceProvider(configuration, model, routeName); + request.ODataFeature().RequestContainer = serviceProvider; + HttpContext httpContext = request.HttpContext; + httpContext.RequestServices = serviceProvider; + + ActionDescriptor actionDescriptor = ControllerDescriptorFactory + .Create(configuration, "CustomersController", typeof(CustomersController)) + .First(descriptor => descriptor.ActionName.StartsWith("Get", StringComparison.OrdinalIgnoreCase)); + ActionContext actionContext = new ActionContext(httpContext, new RouteData(), actionDescriptor); + + ActionExecutedContext context = new ActionExecutedContext(actionContext, new List(), new CustomersController()); + context.Result = new ObjectResult(new List()) { StatusCode = 200 }; + + EnableQueryAttribute attribute = new EnableQueryAttribute(); + + // Act and Assert + ExceptionAssert.DoesNotThrow(() => attribute.OnActionExecuted(context)); + + Assert.NotNull(context.Result as ObjectResult); + } + + private IServiceProvider GetServiceProvider(IRouteBuilder builder, IEdmModel model, string routeName) + { + IPerRouteContainer perRouteContainer = builder.ServiceProvider.GetRequiredService(); + + // Create an service provider for this route. Add the default services to the custom configuration actions. + Action builderAction = ODataRouteBuilderExtensions.ConfigureDefaultServices(builder, b => + { + b.AddService(Microsoft.OData.ServiceLifetime.Singleton, sp => model); + }); + return perRouteContainer.CreateODataRootContainer(routeName, builderAction); + } + [Fact] public void OnActionExecuting_Throws_Null_Context() { @@ -871,8 +950,7 @@ public void SingleOrDefault_IQueryableOfT_OneElementInSequence_ReturnsElement() Customer customer = new Customer(); IQueryable queryable = new[] { customer }.AsQueryable(); HttpActionDescriptor actionDescriptor = new Mock().Object; - - var result = EnableQueryAttribute.SingleOrDefault(queryable, new WebApiActionDescriptor(actionDescriptor)); + var result = QueryHelpers.SingleOrDefault(queryable, new WebApiActionDescriptor(actionDescriptor)); Assert.Same(customer, result); } @@ -883,7 +961,7 @@ public void SingleOrDefault_IQueryableOfT_ZeroElementsInSequence_ReturnsNull() IQueryable queryable = Enumerable.Empty().AsQueryable(); HttpActionDescriptor actionDescriptor = new Mock().Object; - var result = EnableQueryAttribute.SingleOrDefault(queryable, new WebApiActionDescriptor(actionDescriptor)); + var result = QueryHelpers.SingleOrDefault(queryable, new WebApiActionDescriptor(actionDescriptor)); Assert.Null(result); } @@ -900,7 +978,7 @@ public void SingleOrDefault_IQueryableOfT_MoreThaneOneElementInSequence_Throws() }; ExceptionAssert.Throws( - () => EnableQueryAttribute.SingleOrDefault(queryable, new WebApiActionDescriptor(actionDescriptor)), + () => QueryHelpers.SingleOrDefault(queryable, new WebApiActionDescriptor(actionDescriptor)), "The action 'SomeAction' on controller 'SomeName' returned a SingleResult containing more than one element. " + "SingleResult must have zero or one elements."); } @@ -926,7 +1004,7 @@ public void SingleOrDefault_DisposeCalled_EmptySequence() }; // Act - EnableQueryAttribute.SingleOrDefault(queryable.Object, new WebApiActionDescriptor(actionDescriptor)); + QueryHelpers.SingleOrDefault(queryable.Object, new WebApiActionDescriptor(actionDescriptor)); // Assert disposable.Verify(); @@ -954,7 +1032,7 @@ public void SingleOrDefault_DisposeCalled_OneElementInSequence() }; // Act - EnableQueryAttribute.SingleOrDefault(queryable.Object, new WebApiActionDescriptor(actionDescriptor)); + QueryHelpers.SingleOrDefault(queryable.Object, new WebApiActionDescriptor(actionDescriptor)); // Assert disposable.Verify(); @@ -984,7 +1062,7 @@ public void SingleOrDefault_DisposeCalled_MultipleElementsInSequence() // Act (will throw) try { - EnableQueryAttribute.SingleOrDefault(queryable.Object, new WebApiActionDescriptor(actionDescriptor)); + QueryHelpers.SingleOrDefault(queryable.Object, new WebApiActionDescriptor(actionDescriptor)); } catch { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ExpressionHelpersTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ExpressionHelpersTest.cs index fc33cb60d3..619d61d41a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ExpressionHelpersTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ExpressionHelpersTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/AggregationBinderTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/AggregationBinderTests.cs index 3f17c587f7..136d61879a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/AggregationBinderTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/AggregationBinderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/DataModel.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/DataModel.cs index 95d6836cae..3b18c15bcb 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/DataModel.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/DataModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/DynamicTypeWrapperTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/DynamicTypeWrapperTests.cs index 63c7b23066..94ba0353c8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/DynamicTypeWrapperTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/DynamicTypeWrapperTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Query.Expressions; using Xunit; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/ExpressionStringBuilder.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/ExpressionStringBuilder.cs index 018cb9c193..7377b7c3f4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/ExpressionStringBuilder.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/ExpressionStringBuilder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/FilterBinderTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/FilterBinderTests.cs index 6b2ddf1d9a..46480f700e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/FilterBinderTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/FilterBinderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -2909,6 +2913,44 @@ public void Constants_Are_Not_Parameterized_IfDisabled() Assert.Equal("$it => ($it.ProductName == \"1\")", (filters.WithoutNullPropagation as Expression).ToString()); } + [Fact] + public void DateTimeConstants_Are_Parameterized() + { + TimeZoneInfoHelper.TimeZone = TimeZoneInfo.Utc; + VerifyQueryDeserialization("Birthday eq 2016-11-08Z", + "$it => ($it.Birthday == 11/08/2016 00:00:00)", + NotTesting); + } + + [Fact] + public void DateTimeConstants_Are_Not_Parameterized_IfDisabled() + { + TimeZoneInfoHelper.TimeZone = TimeZoneInfo.Utc; + VerifyQueryDeserialization("Birthday eq 2016-11-08Z", "$it => ($it.Birthday == 11/08/2016 00:00:00)", settingsCustomizer: (settings) => + { + settings.EnableConstantParameterization = false; + }); + } + + [Fact] + public void DateTimeOffsetsConstants_Are_Parameterized() + { + TimeZoneInfoHelper.TimeZone = TimeZoneInfo.Utc; + VerifyQueryDeserialization("NonNullableDiscontinuedDate eq 2016-11-08T00:00:00+00:00", + "$it => ($it.NonNullableDiscontinuedDate == 11/08/2016 00:00:00 +00:00)", + NotTesting); + } + + [Fact] + public void DateTimeOffsetsConstants_Are_Not_Parameterized_IfDisabled() + { + TimeZoneInfoHelper.TimeZone = TimeZoneInfo.Utc; + VerifyQueryDeserialization("NonNullableDiscontinuedDate eq 2016-11-08T00:00:00+00:00", "$it => ($it.NonNullableDiscontinuedDate == 11/08/2016 00:00:00 +00:00)", settingsCustomizer: (settings) => + { + settings.EnableConstantParameterization = false; + }); + } + [Fact] public void CollectionConstants_Are_Parameterized() { @@ -2977,6 +3019,17 @@ public void InOnPrimitiveCollectionPropertyOnRHS(int[] alternateIds, bool withNu new { WithNullPropagation = withNullPropagation, WithoutNullPropagation = withNullPropagation }); } + [Theory] + [InlineData("AlternateAddresses/$count gt 2", "$it => ($it.AlternateAddresses.LongCount() > 2)", "$it => ((IIF(($it.AlternateAddresses == null), null, Convert($it.AlternateAddresses.LongCount())) > Convert(2)) == True)")] // Products?$filter=AlternateAddresses/$count gt 2 + [InlineData("Category/Products/$count($filter=ProductID gt 2) gt 2", "$it => ($it.Category.Products.Where($it => ($it.ProductID > 2)).LongCount() > 2)", "$it => ((IIF((IIF(($it.Category == null), null, $it.Category.Products).Where($it => ($it.ProductID > 2)) == null), null, Convert(IIF(($it.Category == null), null, $it.Category.Products).Where($it => ($it.ProductID > 2)).LongCount())) > Convert(2)) == True)")] // Products?$filter=Category/Products/$count($filter=ProductID gt 2) gt 2 + public void CountExpression(string clause, string expectedExpression, string expectedExpressionWithNullPropagation) + { + VerifyQueryDeserialization( + clause, + expectedExpression, + expectedExpressionWithNullPropagation); + } + #region Negative Tests [Fact] diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/Linq2ObjectsComparisonMethodsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/Linq2ObjectsComparisonMethodsTest.cs index 95d8edef54..634cfd206f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/Linq2ObjectsComparisonMethodsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/Linq2ObjectsComparisonMethodsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Query.Expressions; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/LinqParameterContainerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/LinqParameterContainerTest.cs index b044044792..d1802301a3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/LinqParameterContainerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/LinqParameterContainerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq.Expressions; using Microsoft.AspNet.OData.Query.Expressions; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/ModelContainerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/ModelContainerTest.cs index 169fb482ef..996f35ab06 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/ModelContainerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/ModelContainerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Query.Expressions; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/PropertyContainerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/PropertyContainerTest.cs index b09751b366..e535a89ea7 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/PropertyContainerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/PropertyContainerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandBinderTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandBinderTest.cs index 80b8def358..b360b48ed5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandBinderTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandBinderTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; @@ -862,6 +866,67 @@ public void ProjectAsWrapper_Element_ExpandAndMultipleOrderBy_ShouldOrder() Assert.Equal(4, fourth.Id); } + [Theory] + [InlineData("Orders($filter=Customer/HomeAddress/Cities/any(e:e/CityName eq 1001))", new[] { "QueryOrder1" })] + [InlineData("Orders($filter=Customer/HomeAddress/Cities/any(e:e/CityName eq 1002))", new[] { "QueryOrder1", "QueryOrder3" })] + [InlineData("Orders($filter=Customer/HomeAddress/Cities/any(e:e/CityName eq 1003))", new[] { "QueryOrder2", "QueryOrder3" })] + public void ProjectAsWrapper_Element_ExpandAndFilterByAny(string expand, object expected) + { + // Arrange + // Customer?$expand=Orders($filter=Customer/HomeAddress/Cities/any(e:e/CityName eq 1001)) + // Customer?$expand=Orders($filter=Customer/HomeAddress/Cities/any(e:e/CityName eq 1002)) + // Customer?$expand=Orders($filter=Customer/HomeAddress/Cities/any(e:e/CityName eq 1003)) + + var city1 = new QueryCity() { Id = 1, CityName = 1001 }; + var city2 = new QueryCity() { Id = 2, CityName = 1002 }; + var city3 = new QueryCity() { Id = 3, CityName = 1003 }; + var city4 = new QueryCity() { Id = 4, CityName = 1004 }; + + QueryCustomer customer1 = new QueryCustomer + { + HomeAddress = new QueryAddress + { + Cities = new List() { city1, city2 } + } + }; + + QueryCustomer customer2 = new QueryCustomer + { + HomeAddress = new QueryAddress + { + Cities = new List() { city3, city4 } + } + }; + + QueryCustomer customer3 = new QueryCustomer + { + HomeAddress = new QueryAddress + { + Cities = new List() { city2, city3 } + } + }; + + var orders = new List + { + new QueryOrder{ Title = "QueryOrder1", Customer = customer1 }, + new QueryOrder{ Title = "QueryOrder2", Customer = customer2 }, + new QueryOrder{ Title = "QueryOrder3", Customer = customer3 }, + }; + + Expression source = Expression.Constant(new QueryCustomer() { Orders = orders }); + SelectExpandClause selectExpandClause = ParseSelectExpand(null, expand, _model, _customer, _customers); + Assert.NotNull(selectExpandClause); + + // Act + Expression projection = _binder.ProjectAsWrapper(source, selectExpandClause, _customer, _customers); + + // Assert + var customerWrappers = Expression.Lambda(projection).Compile().DynamicInvoke() as SelectExpandWrapper; + var orderWrappers = customerWrappers.Container.ToDictionary(PropertyMapper)["Orders"] as IEnumerable>; + var orderTitleList = orderWrappers.Select(s => s.Instance.Title).ToList(); + Assert.Equal(expected, orderTitleList); + } + [Fact] public void ProjectAsWrapper_Element_ProjectedValueContainsSubKeys_IfDollarRefInDollarExpandOnSubNavigationProperty() { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandIncludePropertyTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandIncludePropertyTest.cs index 94f9b4cce8..bcc271597c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandIncludePropertyTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandIncludePropertyTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Query.Expressions; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandIncludedPropertyTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandIncludedPropertyTest.cs index 619880fc60..aa8c2a0348 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandIncludedPropertyTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandIncludedPropertyTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Query.Expressions; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandPathExtensionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandPathExtensionsTest.cs index 0a3e9f594f..9553e692a5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandPathExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandPathExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandWrapperTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandWrapperTest.cs index 7aaca0ff8e..c2ff968ce6 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandWrapperTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/SelectExpandWrapperTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/UriFunctionBinderTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/UriFunctionBinderTests.cs index d0054c9865..d0771255ce 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/UriFunctionBinderTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Expressions/UriFunctionBinderTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/FilterQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/FilterQueryOptionTest.cs index 7fd5a0f17b..b05cbd901b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/FilterQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/FilterQueryOptionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/HandleNullPropagationOptionHelperTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/HandleNullPropagationOptionHelperTest.cs index ee74ab0d1b..e445a38929 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/HandleNullPropagationOptionHelperTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/HandleNullPropagationOptionHelperTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/HttpActionDescriptorExtensionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/HttpActionDescriptorExtensionTests.cs index 12d47aeb4c..a84c85c368 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/HttpActionDescriptorExtensionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/HttpActionDescriptorExtensionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETFX // HttpActionDescriptor.GetEdmModel implmention is part of EnableQueryAttribute.GetModel on AspNetCore using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataPathQueryBuilderTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataPathQueryBuilderTest.cs new file mode 100644 index 0000000000..a49068b90e --- /dev/null +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataPathQueryBuilderTest.cs @@ -0,0 +1,348 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; +using System.Collections.Generic; +using System.ComponentModel.DataAnnotations; +using System.Linq; +using Microsoft.AspNet.OData.Builder; +using Microsoft.AspNet.OData.Query; +using Microsoft.AspNet.OData.Routing; +using Microsoft.AspNet.OData.Test.Common; +using Microsoft.AspNet.OData.Test.Query.Expressions; +using Microsoft.OData.Edm; +using Xunit; + +namespace Microsoft.AspNet.OData.Test.Query +{ + public class ODataPathQueryBuilderTest + { + public static TheoryDataSet TestData + { + get + { + return new TheoryDataSet + { + { + "Customers", + "ODataPathQuery_Customer[]" + }, + { + "Customers(1)", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1))" + }, + { + "Customers(1)/Name", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Select( => .Name)" + }, + // collection navigation properties + { + "Customers(1)/Products", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Products)" + }, + { + "Customers(1)/Products(2)", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Products).Where(entity => (entity.Id == 2))" + }, + { + "Customers(1)/Products(2)/Name", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Products).Where(entity => (entity.Id == 2)).Select( => .Name)" + }, + // non-collection navigation property + { + "Customers(1)/FavoriteProduct", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Where( => (.FavoriteProduct != null)).Select( => .FavoriteProduct)" + }, + { + "Customers(1)/FavoriteProduct/Name", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Where( => (.FavoriteProduct != null)).Select( => .FavoriteProduct).Select( => .Name)" + }, + // collection complex properties + { + "Customers(1)/Addresses", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Addresses)" + }, + // non-collection complex properties + { + "Customers(1)/HomeAddress", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Select( => .HomeAddress)" + }, + { + "Customers(1)/HomeAddress/City", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Select( => .HomeAddress).Select( => .City)" + }, + // key segments with composite-keys + { + "Customers(1)/Projects(2, 'abc')", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Projects).Where(entity => ((entity.KeyOne == 2) AndAlso (entity.KeyTwo == abc)))" + }, + { + "Customers(1)/Projects(2, 'abc')/IsDone", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Projects).Where(entity => ((entity.KeyOne == 2) AndAlso (entity.KeyTwo == abc))).Select( => .IsDone)" + }, + // paths with singleton navigation source + { + "TopCustomer", + "ODataPathQuery_Customer[]" + }, + { + "TopCustomer/Name", + "ODataPathQuery_Customer[].Select( => .Name)" + }, + { + "TopCustomer/HomeAddress", + "ODataPathQuery_Customer[].Select( => .HomeAddress)" + }, + { + "TopCustomer/Addresses", + "ODataPathQuery_Customer[].SelectMany( => .Addresses)" + }, + { + "TopCustomer/HomeAddress/City", + "ODataPathQuery_Customer[].Select( => .HomeAddress).Select( => .City)" + }, + { + "TopCustomer/Products", + "ODataPathQuery_Customer[].SelectMany( => .Products)" + }, + { + "TopCustomer/Products(2)", + "ODataPathQuery_Customer[].SelectMany( => .Products).Where(entity => (entity.Id == 2))" + }, + { + "TopCustomer/Products(2)/Name", + "ODataPathQuery_Customer[].SelectMany( => .Products).Where(entity => (entity.Id == 2)).Select( => .Name)" + }, + { + "TopCustomer/FavoriteProduct", + "ODataPathQuery_Customer[].Where( => (.FavoriteProduct != null)).Select( => .FavoriteProduct)" + }, + { + "TopCustomer/FavoriteProduct/Name", + "ODataPathQuery_Customer[].Where( => (.FavoriteProduct != null)).Select( => .FavoriteProduct).Select( => .Name)" + }, + }; + } + } + + public static TheoryDataSet CountTestData + { + get + { + return new TheoryDataSet + { + { + "Customers/$count", + "ODataPathQuery_Customer[]" + }, + { + "Customers(1)/Products/$count", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Products)" + }, + { + "Customers(1)/Addresses/$count", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Addresses)" + } + }; + } + } + + public static TheoryDataSet ValueTestData + { + get + { + return new TheoryDataSet + { + { + "Customers(1)/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1))" + }, + { + "Customers(1)/Name/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Select( => .Name)" + }, + { + "Customers(1)/Products(2)/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Products).Where(entity => (entity.Id == 2))" + }, + { + "Customers(1)/Products(2)/Name/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Products).Where(entity => (entity.Id == 2)).Select( => .Name)" + }, + { + "Customers(1)/FavoriteProduct/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Where( => (.FavoriteProduct != null)).Select( => .FavoriteProduct)" + }, + { + "Customers(1)/FavoriteProduct/Name/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Where( => (.FavoriteProduct != null)).Select( => .FavoriteProduct).Select( => .Name)" + }, + { + "Customers(1)/HomeAddress/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Select( => .HomeAddress)" + }, + { + "Customers(1)/HomeAddress/City/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).Select( => .HomeAddress).Select( => .City)" + }, + { + "Customers(1)/Projects(2, 'abc')/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Projects).Where(entity => ((entity.KeyOne == 2) AndAlso (entity.KeyTwo == abc)))" + }, + { + "Customers(1)/Projects(2, 'abc')/IsDone/$value", + "ODataPathQuery_Customer[].Where(entity => (entity.Id == 1)).SelectMany( => .Projects).Where(entity => ((entity.KeyOne == 2) AndAlso (entity.KeyTwo == abc))).Select( => .IsDone)" + }, + }; + } + } + + [Theory] + [MemberData(nameof(TestData))] + public void BuildQuery_TransformsQueryBasedOnPathSegments(string path, string expectedQuery) + { + var model = ODataPathQueryModel.GetModel(); + var pathHandler = new DefaultODataPathHandler(); + var odataPath = pathHandler.Parse(model, "http://any/", path); + IQueryable source = Array.CreateInstance(typeof(ODataPathQuery_Customer), 0).AsQueryable(); + var queryBuilder = new ODataPathQueryBuilder(source, odataPath); + ODataPathQueryResult result = queryBuilder.BuildQuery(); + + string queryExpression = ExpressionStringBuilder.ToString(result.Result.Expression); + queryExpression = RemoveNameSpace(queryExpression); + + Assert.Equal(expectedQuery, queryExpression); + Assert.False(result.HasCountSegment); + Assert.False(result.HasValueSegment); + } + + [Theory] + [MemberData(nameof(CountTestData))] + public void BuildQuery_SetsCountFlagToTrue_IfPathHasCountSegment(string path, string expectedQuery) + { + var model = ODataPathQueryModel.GetModel(); + var pathHandler = new DefaultODataPathHandler(); + var odataPath = pathHandler.Parse(model, "http://any/", path); + IQueryable source = Array.CreateInstance(typeof(ODataPathQuery_Customer), 0).AsQueryable(); + var queryBuilder = new ODataPathQueryBuilder(source, odataPath); + ODataPathQueryResult result = queryBuilder.BuildQuery(); + + string queryExpression = ExpressionStringBuilder.ToString(result.Result.Expression); + queryExpression = RemoveNameSpace(queryExpression); + + Assert.Equal(expectedQuery, queryExpression); + Assert.False(result.HasValueSegment); + Assert.True(result.HasCountSegment); + } + + [Theory] + [MemberData(nameof(ValueTestData))] + public void BuildQuery_SetValueFlagToTrue_IfPathHasValueSegment(string path, string expectedQuery) + { + var model = ODataPathQueryModel.GetModel(); + var pathHandler = new DefaultODataPathHandler(); + var odataPath = pathHandler.Parse(model, "http://any/", path); + IQueryable source = Array.CreateInstance(typeof(ODataPathQuery_Customer), 0).AsQueryable(); + var queryBuilder = new ODataPathQueryBuilder(source, odataPath); + ODataPathQueryResult result = queryBuilder.BuildQuery(); + + string queryExpression = ExpressionStringBuilder.ToString(result.Result.Expression); + queryExpression = RemoveNameSpace(queryExpression); + + Assert.Equal(expectedQuery, queryExpression); + Assert.True(result.HasValueSegment); + Assert.False(result.HasCountSegment); + } + + [Theory] + [InlineData("Customers(1)/GetMostPurchasedProduct()")] + [InlineData("Products/SetDiscountRate()")] + [InlineData("Customers(1)/Microsoft.AspNet.OData.Test.Query.ODataPathQuery_VipCustomer")] + public void BuildQuery_ReturnsNull_IfPathHasUnsupportedSegmen(string path) + { + var model = ODataPathQueryModel.GetModel(); + var pathHandler = new DefaultODataPathHandler(); + var odataPath = pathHandler.Parse(model, "http://any/", path); + IQueryable source = Array.CreateInstance(typeof(ODataPathQuery_Customer), 0).AsQueryable(); + var queryBuilder = new ODataPathQueryBuilder(source, odataPath); + ODataPathQueryResult result = queryBuilder.BuildQuery(); + + Assert.Null(result); + } + + private string RemoveNameSpace(string fullTypeName) + { + string ns = typeof(ODataPathQuery_Customer).Namespace; + return fullTypeName.Replace($"{ns}.", ""); + } + } + + public static class ODataPathQueryModel + { + public static IEdmModel GetModel() + { + var builder = new ODataConventionModelBuilder(); + builder.EntitySet("Customers"); + builder.EntitySet("Products"); + builder.EntitySet("Projects"); + builder.ComplexType(); + builder.Singleton("TopCustomer"); + + builder.EntityType(); + + builder.EntityType() + .Function("GetMostPurchasedProduct") + .ReturnsFromEntitySet("Products"); + + builder.EntityType() + .Collection + .Action("SetDiscountRate"); + + return builder.GetEdmModel(); + } + } + + + public class ODataPathQuery_Customer + { + public int Id { get; set; } + public string Name { get; set; } + public ODataPathQuery_Address HomeAddress { get; set; } + public List Emails { get; set; } + public List Addresses { get; set; } + public ODataPathQuery_Product FavoriteProduct { get; set; } + public List Products { get; set; } + public List Projects { get; set; } + } + + public class ODataPathQuery_VipCustomer: ODataPathQuery_Customer + { + } + + public class ODataPathQuery_Product + { + public int Id { get; set; } + public string Name { get; set; } + public int Price { get; set; } + } + + public class ODataPathQuery_Project + { + [Key] + public int KeyOne { get; set; } + [Key] + public string KeyTwo { get; set; } + public string Description { get; set; } + public bool IsDone { get; set; } + } + + public class ODataPathQuery_Address + { + public string City { get; set; } + public string Street { get; set; } + } +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryContextTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryContextTests.cs index fb37795ddd..d6937c1aed 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryContextTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryContextTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionParserExtensionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionParserExtensionTest.cs index ef5cb8de39..20a506c97c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionParserExtensionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionParserExtensionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionTest.cs index 78d5411520..09d59ab234 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionsOfTEntityTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionsOfTEntityTest.cs index ad3c244455..389b18b103 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionsOfTEntityTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryOptionsOfTEntityTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryParameterBindingAttributeTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryParameterBindingAttributeTests.cs index bc04f4168c..7bca517efb 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryParameterBindingAttributeTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQueryParameterBindingAttributeTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCORE // TODO #939: Enable these test on AspNetCore. using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQuerySettingsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQuerySettingsTest.cs index 34d1405896..d3ce9038f3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQuerySettingsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataQuerySettingsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataSingletonQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataSingletonQueryOptionTest.cs index 8fd10c91d5..76ea40258a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataSingletonQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataSingletonQueryOptionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataValidationSettingsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataValidationSettingsTest.cs index 508b2a0401..c94a0c63f1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataValidationSettingsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ODataValidationSettingsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/OrderByPropertyNodeTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/OrderByPropertyNodeTest.cs index 8761105da9..e47749ef18 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/OrderByPropertyNodeTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/OrderByPropertyNodeTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/OrderByQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/OrderByQueryOptionTest.cs index 2e2e23f479..949e6492c5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/OrderByQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/OrderByQueryOptionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ParameterAliasNodeTranslatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ParameterAliasNodeTranslatorTest.cs index cc0bcd44df..d0316ef424 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ParameterAliasNodeTranslatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/ParameterAliasNodeTranslatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/PlainTextODataQueryOptionsParserTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/PlainTextODataQueryOptionsParserTest.cs index 38d5192813..9ecf9fd3ab 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/PlainTextODataQueryOptionsParserTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/PlainTextODataQueryOptionsParserTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.IO; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryCompositionControllers.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryCompositionControllers.cs index ed6dc72045..21c7b92968 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryCompositionControllers.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryCompositionControllers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryCompositionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryCompositionTests.cs index af6232312a..c7228f5a9a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryCompositionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryCompositionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryableFilterProviderTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryableFilterProviderTest.cs index 259a4c1822..17bcf3c2e1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryableFilterProviderTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/QueryableFilterProviderTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SelectExpandQueryOptionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SelectExpandQueryOptionTest.cs index 5c34fb2258..25b9a4ca1a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SelectExpandQueryOptionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SelectExpandQueryOptionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SkipQueryOptionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SkipQueryOptionTests.cs index bac53a0592..773867b158 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SkipQueryOptionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/SkipQueryOptionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/TopQueryOptionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/TopQueryOptionTests.cs index 98b4297a96..f11ae3b221 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/TopQueryOptionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/TopQueryOptionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/TruncatedCollectionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/TruncatedCollectionTest.cs index d9cb6eadff..cc408d3c1b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/TruncatedCollectionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/TruncatedCollectionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Query; using Microsoft.AspNet.OData.Test.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/CountQueryValidatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/CountQueryValidatorTest.cs index 45f5007d4b..d4dc576abf 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/CountQueryValidatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/CountQueryValidatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -124,4 +128,4 @@ private class LimitedRelatedEntity public LimitedComplex[] ComplexCollectionProperty { get; set; } } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/FilterQueryValidatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/FilterQueryValidatorTest.cs index 2a469146c1..c9a3fabe52 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/FilterQueryValidatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/FilterQueryValidatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ODataQueryValidatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ODataQueryValidatorTest.cs index c7f0a879f7..77606e67af 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ODataQueryValidatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ODataQueryValidatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/OrderByQueryValidatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/OrderByQueryValidatorTest.cs index 2c7de1d0d1..d978040542 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/OrderByQueryValidatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/OrderByQueryValidatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/SelectExpandQueryValidatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/SelectExpandQueryValidatorTest.cs index 554d3bd96e..a502793ec1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/SelectExpandQueryValidatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/SelectExpandQueryValidatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Globalization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/SkipQueryValidatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/SkipQueryValidatorTest.cs index 7055ec06ba..eb477e79aa 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/SkipQueryValidatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/SkipQueryValidatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Query; @@ -70,4 +74,4 @@ public void ValidatePassWhenLimitIsNotReached() ExceptionAssert.DoesNotThrow(() => _validator.Validate(new SkipQueryOption("9", _context), settings)); } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/TopQueryValidatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/TopQueryValidatorTest.cs index f554f78e50..f132a3cf2b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/TopQueryValidatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/TopQueryValidatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Query; @@ -107,4 +111,4 @@ public void ValidateThrowsWhenQuerySettingsLimitIsExceeded() "The limit of '10' for Top query has been exceeded. The value from the incoming request is '11'."); } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ValidationTestHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ValidationTestHelper.cs index e9e9f23395..3cc0b0b018 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ValidationTestHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Query/Validators/ValidationTestHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Test.Abstraction; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/QueryableLimitationTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/QueryableLimitationTest.cs index f3852ebe7a..3ce42fca54 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/QueryableLimitationTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/QueryableLimitationTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ResourceContextTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ResourceContextTest.cs index 84c77e3da0..214d88010d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ResourceContextTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/ResourceContextTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources.cs index d02f751dfc..110b4c3150 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Resources.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.IO; using Microsoft.AspNet.OData.Common; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/CreatedODataResultTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/CreatedODataResultTest.cs index 503366ca7e..f2fa1ff799 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/CreatedODataResultTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/CreatedODataResultTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/ResultHelpersTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/ResultHelpersTest.cs index aca225e391..faaed7d5de 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/ResultHelpersTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/ResultHelpersTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/UpdatedODataResultTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/UpdatedODataResultTest.cs index cc00fac113..a73920d839 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/UpdatedODataResultTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Results/UpdatedODataResultTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingOnSingletonTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingOnSingletonTest.cs index 2193eccf30..b473221b41 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingOnSingletonTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingOnSingletonTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingTest.cs index 6232b0e7fa..c5125d51bf 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; @@ -140,6 +144,13 @@ public string PostCustomerFromSpecialCustomer() return "PostCustomerFromSpecialCustomer"; } + [HttpPatch] + [ODataRoute("Customers/NS.SpecialCustomer")] + public string PatchCustomerFromSpecialCustomer() + { + return "PatchCustomerFromSpecialCustomer"; + } + [HttpPost] [ODataRoute("Customers")] public string CreateCustomer() diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingUnboundTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingUnboundTest.cs index eae42c59ce..36cb36feb8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingUnboundTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/AttributeRoutingUnboundTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/ActionRoutingConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/ActionRoutingConventionTest.cs index dfe41f2835..f69b02ce2f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/ActionRoutingConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/ActionRoutingConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/AttributeRoutingConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/AttributeRoutingConventionTest.cs index 0604591601..09a8e339ea 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/AttributeRoutingConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/AttributeRoutingConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/DynamicPropertyRoutingConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/DynamicPropertyRoutingConventionTest.cs index 5fd292e9a3..00554db432 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/DynamicPropertyRoutingConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/DynamicPropertyRoutingConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; @@ -241,4 +245,4 @@ public void SelectAction_OnSingltonPath_OpenEntityType_ReturnsTheActionName(stri } #endregion } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/EntityRoutingConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/EntityRoutingConventionTest.cs index 081db646f1..1d3e74e86e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/EntityRoutingConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/EntityRoutingConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using Microsoft.AspNet.OData.Routing; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/EntitySetRoutingConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/EntitySetRoutingConventionTest.cs index f88378e0aa..13f568fa66 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/EntitySetRoutingConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/EntitySetRoutingConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using Microsoft.AspNet.OData.Routing; @@ -33,6 +37,28 @@ public void SelectAction_ReturnsNull_IfActionIsMissing(string method) Assert.Empty(SelectActionHelper.GetRouteData(request).Values); } + [Theory] + [InlineData("POST", "PostCustomer")] + [InlineData("PATCH", "PatchCustomers")] + public void SelectAction_Returns_ExpectedActionName(string method, string expected) + { + // Arrange + CustomersModelWithInheritance model = new CustomersModelWithInheritance(); + + IEdmCollectionType collection = new EdmCollectionType(new EdmEntityTypeReference(model.SpecialCustomer, isNullable: false)); + + ODataPath odataPath = new ODataPath(new EntitySetSegment(model.Customers)); + + var request = RequestFactory.Create(new HttpMethod(method), "http://localhost/"); + var actionMap = SelectActionHelper.CreateActionMap(expected); + + // Act + string selectedAction = SelectActionHelper.SelectAction(new EntitySetRoutingConvention(), odataPath, request, actionMap); + + // Assert + Assert.Equal(expected, selectedAction); + } + [Theory] [InlineData("GET", "GetCustomersFromSpecialCustomer")] [InlineData("POST", "PostCustomerFromSpecialCustomer")] diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/FunctionRoutingConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/FunctionRoutingConventionTests.cs index eda9e9ee27..e5a8ab2a5b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/FunctionRoutingConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/FunctionRoutingConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/MockNavigationSourceRoutingConvention.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/MockNavigationSourceRoutingConvention.cs index c0943e4187..9f4437e6df 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/MockNavigationSourceRoutingConvention.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/MockNavigationSourceRoutingConvention.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Routing.Conventions; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NavigationRoutingConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NavigationRoutingConventionTest.cs index b9891237f4..f3b94dbc70 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NavigationRoutingConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NavigationRoutingConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NavigationSourceRoutingConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NavigationSourceRoutingConventionTest.cs index 25422c7ce1..40505551dc 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NavigationSourceRoutingConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NavigationSourceRoutingConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NestedPathsRoutingConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NestedPathsRoutingConventionTests.cs new file mode 100644 index 0000000000..dd0704ef38 --- /dev/null +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/NestedPathsRoutingConventionTests.cs @@ -0,0 +1,159 @@ +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +#if NETCORE +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Http; +using System.Reflection; +using System.Text; +using Microsoft.AspNet.OData.Routing; +using Microsoft.AspNet.OData.Routing.Conventions; +using Microsoft.AspNet.OData.Test.Abstraction; +using Xunit; + +namespace Microsoft.AspNet.OData.Test.Routing.Conventions +{ + public class NestedPathsRoutingConventionTests + { + [Theory] + [InlineData("RoutingCustomers", "Get")] + [InlineData("RoutingCustomers", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)", "Get")] + [InlineData("RoutingCustomers(1)", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)/Name", "Get")] + [InlineData("RoutingCustomers(1)/Name", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)/Address", "Get")] + [InlineData("RoutingCustomers(1)/Address", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)/Products", "Get")] + [InlineData("RoutingCustomers(1)/Products", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)/Products(2)/Name", "Get")] + [InlineData("RoutingCustomers(1)/Products(2)/Name", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)/Products/$count", "Get")] + [InlineData("RoutingCustomers(1)/Products/$count", "GetRoutingCustomers")] + public void SelectAction_ReturnsGetAction_IfActionHasNestedPathsAttribute(string path, string expectedAction) + { + // Arrange + ODataPath odataPath = new DefaultODataPathHandler().Parse(ODataRoutingModel.GetModel(), "http://any", path); + var request = RequestFactory.Create(new HttpMethod("GET"), "http://localhost/"); + var actionMap = SelectActionHelper.CreateActionMap(expectedAction); + actionMap.First().MethodInfo = GetMethodWithNestedPathsAttribute(); + + // Act + string selectedAction = SelectActionHelper.SelectAction(new NestedPathsRoutingConvention(), odataPath, request, actionMap); + + // Assert + Assert.Equal(expectedAction, selectedAction); + } + + [Theory] + [InlineData("RoutingCustomers")] + [InlineData("RoutingCustomers(1)")] + [InlineData("RoutingCustomers(1)/Name")] + [InlineData("RoutingCustomers(1)/Products")] + public void SelectAction_ReturnsNull_IfActionIsMissing(string path) + { + // Arrange + ODataPath odataPath = new DefaultODataPathHandler().Parse(ODataRoutingModel.GetModel(), "http://any", path); + var request = RequestFactory.Create(new HttpMethod("GET"), "http://localhost/"); + var actionMap = SelectActionHelper.CreateActionMap(); + + // Act + string selectedAction = SelectActionHelper.SelectAction(new NestedPathsRoutingConvention(), odataPath, request, actionMap); + + // Assert + Assert.Null(selectedAction); + } + + [Theory] + [InlineData("RoutingCustomers", "Get")] + [InlineData("RoutingCustomers", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)", "Get")] + [InlineData("RoutingCustomers(1)", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)/Name", "Get")] + [InlineData("RoutingCustomers(1)/Name", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)/Address", "Get")] + [InlineData("RoutingCustomers(1)/Address", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)/Products", "Get")] + [InlineData("RoutingCustomers(1)/Products", "GetRoutingCustomers")] + [InlineData("RoutingCustomers(1)/Products(2)/Name", "Get")] + [InlineData("RoutingCustomers(1)/Products(2)/Name", "GetRoutingCustomers")] + public void SelectAction_ReturnsNull_IfActionDoesNotHaveNestedPathsAttribute(string path, string action) + { + // Arrange + ODataPath odataPath = new DefaultODataPathHandler().Parse(ODataRoutingModel.GetModel(), "http://any", path); + var request = RequestFactory.Create(new HttpMethod("GET"), "http://localhost/"); + var actionMap = SelectActionHelper.CreateActionMap(action); + actionMap.First().MethodInfo = GetMethodWithoutNestedPathsAttribute(); + + // Act + string selectedAction = SelectActionHelper.SelectAction(new NestedPathsRoutingConvention(), odataPath, request, actionMap); + + // Assert + Assert.Null(selectedAction); + } + + [Theory] + [InlineData("POST", "RoutingCustomers")] + [InlineData("PUT", "RoutingCustomers(1)")] + [InlineData("DELETE", "RoutingCustomers(1)")] + [InlineData("POST", "RoutingCustomers(1)/Products")] + public void SelectAction_ReturnsNull_IfRequestMethodIsNotGet(string method, string path) + { + // Arrange + ODataPath odataPath = new DefaultODataPathHandler().Parse(ODataRoutingModel.GetModel(), "http://any", path); + var request = RequestFactory.Create(new HttpMethod(method), "http://localhost/"); + var actionMap = SelectActionHelper.CreateActionMap("Get"); + actionMap.First().MethodInfo = GetMethodWithNestedPathsAttribute(); + + // Act + string selectedAction = SelectActionHelper.SelectAction(new NestedPathsRoutingConvention(), odataPath, request, actionMap); + + // Assert + Assert.Null(selectedAction); + } + + [Theory] + // $ref requests are currently not supported + [InlineData("RoutingCustomers(1)/Products(1)/$ref")] + public void SelectAction_ReturnsNull_IfUnsupportPathSegment(string path) + { + // Arrange + ODataPath odataPath = new DefaultODataPathHandler().Parse(ODataRoutingModel.GetModel(), "http://any", path); + var request = RequestFactory.Create(new HttpMethod("GET"), "http://localhost/"); + var actionMap = SelectActionHelper.CreateActionMap("Get"); + actionMap.First().MethodInfo = GetMethodWithNestedPathsAttribute(); + + // Act + string selectedAction = SelectActionHelper.SelectAction(new NestedPathsRoutingConvention(), odataPath, request, actionMap); + + // Assert + Assert.Null(selectedAction); + } + + MethodInfo GetMethodWithNestedPathsAttribute() + { + return this.GetType().GetMethod("MethodWithNestedPathsAttribute", BindingFlags.Instance | BindingFlags.NonPublic); + } + + MethodInfo GetMethodWithoutNestedPathsAttribute() + { + return this.GetType().GetMethod("MethodWithoutNestedPathsAttribute", BindingFlags.Instance | BindingFlags.NonPublic); + } + + [EnableNestedPaths] + void MethodWithNestedPathsAttribute() + { + } + + void MethodWithoutNestedPathsAttribute() + { + } + } +} +#endif diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/ODataRoutingConventionsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/ODataRoutingConventionsTest.cs index c531f4c5d4..e496143f87 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/ODataRoutingConventionsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/ODataRoutingConventionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Linq; using Microsoft.AspNet.OData.Routing.Conventions; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/OperationImportRoutingConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/OperationImportRoutingConventionTests.cs index 1a9c755ebf..37e5ee2a70 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/OperationImportRoutingConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/OperationImportRoutingConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/PropertyRoutingConventionTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/PropertyRoutingConventionTests.cs index f10fc5a091..a2825d5fdd 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/PropertyRoutingConventionTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/PropertyRoutingConventionTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/RefRoutingConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/RefRoutingConventionTest.cs index 7fda4a97cf..27974c8084 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/RefRoutingConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/RefRoutingConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/SelectActionHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/SelectActionHelper.cs index a9c4a582b8..4e9c847f60 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/SelectActionHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/SelectActionHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/SingletonRoutingConventionTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/SingletonRoutingConventionTest.cs index c923dcc665..b76218a1bd 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/SingletonRoutingConventionTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Conventions/SingletonRoutingConventionTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/DefaultODataPathHandlerTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/DefaultODataPathHandlerTest.cs index 02d9cec8a6..d735cf3429 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/DefaultODataPathHandlerTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/DefaultODataPathHandlerTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/KeyValueParserTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/KeyValueParserTest.cs index 81be576b97..65150e895a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/KeyValueParserTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/KeyValueParserTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataCountTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataCountTest.cs index bf796d65b9..1cae3286e3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataCountTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataCountTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; @@ -449,4 +453,4 @@ public class DollarCountComplex public string StringProp { get; set; } } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataLevelsTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataLevelsTest.cs index f3c5cae888..582b451e2d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataLevelsTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataLevelsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; @@ -750,4 +754,4 @@ public class LevelsDerivedEntity : LevelsEntity public LevelsEntity[] AncestorsInDerivedEntity { get; set; } } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathRouteConstraintTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathRouteConstraintTest.cs index d063c054e3..f25ce6a7e7 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathRouteConstraintTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathRouteConstraintTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathSegmentTranslatorTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathSegmentTranslatorTest.cs index 7223eff662..7e4305b228 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathSegmentTranslatorTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathSegmentTranslatorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathTest.cs index c006d2592d..0d55b07085 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataPathTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.OData.Edm; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRouteTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRouteTest.cs index f6f51a73e0..bd18771fb8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRouteTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRouteTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRoutingModel.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRoutingModel.cs index e1e0c9a781..08427231f4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRoutingModel.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRoutingModel.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -33,6 +37,8 @@ public static IEdmModel GetModel() builder.EntitySet("NotFoundCustomers"); builder.EntitySet("NotFoundWithIdCustomers"); builder.EntitySet("AttributeCustomers"); + builder.EntitySet("NestedPathsCustomers"); + builder.EntitySet("NestedPathsWithOverridesCustomers"); builder.ComplexType(); builder.ComplexType(); builder.EntityType(); @@ -394,5 +400,19 @@ public class AttributeCustomer public int ID { get; set; } public string Name { get; set; } } + + public class NestedPathsCustomer + { + public int ID { get; set; } + public string Name { get; set; } + public List Products { get; set; } + } + + public class NestedPathsWithOverridesCustomer + { + public int ID { get; set; } + public string Name { get; set; } + public List Products { get; set; } + } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRoutingTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRoutingTest.cs index 6114809c2b..7997ef910e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRoutingTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataRoutingTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; @@ -60,7 +64,12 @@ public ODataRoutingTest() typeof(IncidentsController), typeof(NotFoundWithIdCustomersController), typeof(NotFoundCustomersController), - typeof(AttributeCustomersController) + typeof(AttributeCustomersController), +#if NETCORE +// TODO enable when [EnableNestedPaths] is supported in ASP.NET classic + typeof(NestedPathsCustomersController), + typeof(NestedPathsWithOverridesCustomersController) +#endif }; // Separate clients and servers so routes are not ambiguous. @@ -304,7 +313,30 @@ public static TheoryDataSet ControllerRoutes { "GET", "Products/Default.GetCount(minSalary=1.3, maxSalary=3.4, aveSalary=4.5)", "GetCount(1.3, 3.4, 4.5)" }, // test [ODataRoute] works correctly for overloaded actions { "GET", "AttributeCustomers", "Get()" }, - { "GET", "AttributeCustomers(10)", "Get(10)" } + { "GET", "AttributeCustomers(10)", "Get(10)" }, + +#if NETCORE // TODO enable these scenarios for NETFX when support added for AspNet classic + // test nested paths when there are no user-defined actions that override the [EnableNestedPaths] action + // all Get() requests should route the Get() method with [EnableNestedPaths] + { "GET", "NestedPathsCustomers", "Get()" }, + { "GET", "NestedPathsCustomers(1)", "Get()" }, + { "GET", "NestedPathsCustomers(1)/Name", "Get()" }, + { "GET", "NestedPathsCustomers(1)/Products", "Get()" }, + { "GET", "NestedPathsCustomers(1)/Products(1)/Name", "Get()" }, + { "GET", "NestedPathsCustomers(1)/Products/$count", "Get()" }, + { "GET", "NestedPathsCustomers/$count", "Get()" }, + + // test nested paths when there's both a Get action with [EnableNestedPaths] as well + // as other actions that may handle some GET requests (e.g. Get(int key), GetName(int key), ODataRoute, etc.) + // the latter should take precedence + { "GET", "NestedPathsWithOverridesCustomers", "GetNestedPathsWithOverridesCustomers()" }, + { "GET", "NestedPathsWithOverridesCustomers(1)", "Get(1)" }, + { "GET", "NestedPathsWithOverridesCustomers(1)/Name", "GetName(1)" }, + { "GET", "NestedPathsWithOverridesCustomers(1)/Products(2)/Name", "GetProductName(1, 2)" }, + { "GET", "NestedPathsWithOverridesCustomers(1)/Products/$count", "CountProducts(1)" }, + { "GET", "NestedPathsWithOverridesCustomers(1)/Products", "GetNestedPathsWithOverridesCustomers()" }, + { "GET", "NestedPathsWithOverridesCustomers/$count", "GetNestedPathsWithOverridesCustomers()" }, +#endif }; } } @@ -966,4 +998,49 @@ public string Get(int key) return $"Get({key})"; } } + +#if NETCORE + // TODO: enable for NETFX when [EnableNestedPaths] are supported in AspNet classic + public class NestedPathsCustomersController: TestODataController + { + [EnableNestedPaths] + public string Get() + { + return "Get()"; + } + } + + public class NestedPathsWithOverridesCustomersController: TestODataController + { + [EnableNestedPaths] + public string GetNestedPathsWithOverridesCustomers() + { + return "GetNestedPathsWithOverridesCustomers()"; + } + + public string Get(int key) + { + return $"Get({key})"; + } + + public string GetName(int key) + { + return $"GetName({key})"; + } + + [ODataRoute("NestedPathsWithOverridesCustomers({key})/Products({relatedKey})/Name")] + public string GetProductName(int key, int relatedKey) + { + return $"GetProductName({key}, {relatedKey})"; + } + + [HttpGet] + [ODataRoute("NestedPathsWithOverridesCustomers({key})/Products/$count")] + public string CountProducts(int key) + { + return $"CountProducts({key})"; + } + } +#endif + } diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataSingletonRoutingTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataSingletonRoutingTest.cs index a50fed961c..cd2b864c3a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataSingletonRoutingTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataSingletonRoutingTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataValueProviderFactoryTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataValueProviderFactoryTest.cs index d7e5492885..526b4d2b41 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataValueProviderFactoryTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataValueProviderFactoryTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataVersionConstraintTests.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataVersionConstraintTests.cs index 3a534a5ba1..bc5d7399a8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataVersionConstraintTests.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/ODataVersionConstraintTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/DynamicSegmentTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/DynamicSegmentTemplateTest.cs index baf237f09d..2f73b8ebe2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/DynamicSegmentTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/DynamicSegmentTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Template; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/EntitySetSegmentTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/EntitySetSegmentTemplateTest.cs index e50d5b9a2b..ae4ee147e1 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/EntitySetSegmentTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/EntitySetSegmentTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Template; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/KeySegementTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/KeySegementTemplateTest.cs index cb0814b072..2499892595 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/KeySegementTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/KeySegementTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Template; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/NavigationPropertyLinkSegmentTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/NavigationPropertyLinkSegmentTemplateTest.cs index 9522e5c13d..ea3580bbd9 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/NavigationPropertyLinkSegmentTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/NavigationPropertyLinkSegmentTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Template; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/NavigationPropertySegmentTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/NavigationPropertySegmentTemplateTest.cs index f1021f609a..eaf9d3f7e5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/NavigationPropertySegmentTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/NavigationPropertySegmentTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Template; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/OperationSegmentTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/OperationSegmentTemplateTest.cs index 0341726915..d112b51d85 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/OperationSegmentTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/OperationSegmentTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/PathTemplateSegmentTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/PathTemplateSegmentTemplateTest.cs index 95a800d239..6f1290339a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/PathTemplateSegmentTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/PathTemplateSegmentTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Template; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/PropertySegmentTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/PropertySegmentTemplateTest.cs index 2e553391bb..5befb4ab70 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/PropertySegmentTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/PropertySegmentTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Template; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/SingletonSegmentTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/SingletonSegmentTemplateTest.cs index 482f483ec5..2195cfebf8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/SingletonSegmentTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/SingletonSegmentTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Template; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/TypeSegmentTemplateTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/TypeSegmentTemplateTest.cs index e43dfa73ea..611337169e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/TypeSegmentTemplateTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/Routing/Template/TypeSegmentTemplateTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Routing.Template; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/SelectExpandNestedDollarCountTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/SelectExpandNestedDollarCountTest.cs index 35281c942a..5df9bd0f75 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/SelectExpandNestedDollarCountTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/SelectExpandNestedDollarCountTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/SelectExpandTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/SelectExpandTest.cs index 5379e75594..9b0b5fb10b 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/SelectExpandTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/SelectExpandTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/CustomersModelWithInheritance.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/CustomersModelWithInheritance.cs index fcd4566a32..a32100ccbf 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/CustomersModelWithInheritance.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/CustomersModelWithInheritance.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; using Microsoft.AspNet.OData.Formatter; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/DataSource.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/DataSource.cs index f994dbb5df..4bc20f0be8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/DataSource.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/DataSource.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Test.Common.Models; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/EdmTestHelpers.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/EdmTestHelpers.cs index 8501ba0a4f..096ebe65d3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/EdmTestHelpers.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/EdmTestHelpers.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/Attributed/Person.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/Attributed/Person.cs index a1e5e4ba7b..19c4c1e9d7 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/Attributed/Person.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/Attributed/Person.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Runtime.Serialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/Address.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/Address.cs index 3fa3e96411..cd8ebdf2c3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/Address.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/Address.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Models { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/Gender.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/Gender.cs index 140242c5da..87f7b4b2e4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/Gender.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/Gender.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Models { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/IActivity.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/IActivity.cs index b39650bfe7..3c6f508d80 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/IActivity.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/IActivity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Models { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/PhoneNumber.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/PhoneNumber.cs index 0bc45b07b7..1a846bfde5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/PhoneNumber.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/PhoneNumber.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Models { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/PhoneType.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/PhoneType.cs index 514f91f809..e394e18b7a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/PhoneType.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/ComplexTypes/POCO/PhoneType.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Models { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/Attributed/Employee.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/Attributed/Employee.cs index c11195b190..8e45a5877a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/Attributed/Employee.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/Attributed/Employee.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/POCO/AddressEntity.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/POCO/AddressEntity.cs index 9740938857..0c57726645 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/POCO/AddressEntity.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/POCO/AddressEntity.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Models { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/POCO/WorkItem.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/POCO/WorkItem.cs index 785addcf47..81df1a4f21 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/POCO/WorkItem.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/EntityTypes/POCO/WorkItem.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common.Models { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/NonGenericEnumerable.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/NonGenericEnumerable.cs index 3f17a366b4..43c4ee583e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/NonGenericEnumerable.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/NonGenericEnumerable.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/TestDataModels.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/TestDataModels.cs index eb97555762..f0b10207c8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/TestDataModels.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/Models/TestDataModels.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ODataMediaTypeMapping.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ODataMediaTypeMapping.cs index 44249e452f..f52b1cd304 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ODataMediaTypeMapping.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ODataMediaTypeMapping.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ODataModelBuilderMocks.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ODataModelBuilderMocks.cs index 8107847f3a..ce06c1911f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ODataModelBuilderMocks.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ODataModelBuilderMocks.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if NETCORE using System; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ReferenceDepthContext.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ReferenceDepthContext.cs index a890c6b279..a2b3e59c99 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ReferenceDepthContext.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/ReferenceDepthContext.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenAddress.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenAddress.cs index 690332a773..a9e1dc9259 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenAddress.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenAddress.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNet.OData.Builder; @@ -13,4 +17,4 @@ public class SimpleOpenAddress public IDictionary Properties { get; set; } public ODataInstanceAnnotationContainer InstanceAnnotations { get; set; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenCustomer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenCustomer.cs index d79a3fb9b8..8c666eadf2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenCustomer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenCustomer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; @@ -18,4 +22,4 @@ public class SimpleOpenCustomer public IDictionary CustomerProperties { get; set; } public ODataInstanceAnnotationContainer InstanceAnnotations { get; set; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenOrder.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenOrder.cs index c9d5a37568..9b29e6266f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenOrder.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenOrder.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -18,4 +22,4 @@ public class SimpleOpenOrder public SimpleOpenAddress Address { get; set; } public IDictionary OrderProperties { get; set; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenZipCode.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenZipCode.cs index 6e2c87bd3b..daf73676bb 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenZipCode.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleOpenZipCode.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; @@ -10,4 +14,4 @@ public class SimpleOpenZipCode public int Code { get; set; } public IDictionary Properties { get; set; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleVipCustomer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleVipCustomer.cs index 3cd20977be..d8ddc63835 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleVipCustomer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SimpleVipCustomer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SupportedTypes.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SupportedTypes.cs index 34dfb3c6dd..9a6327d12c 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SupportedTypes.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/SupportedTypes.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/TestControllerBase.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/TestControllerBase.cs index a8fdc4e5a6..2c56593218 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/TestControllerBase.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/TestControllerBase.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Common { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/TypeInitializer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/TypeInitializer.cs index 9e599ef1ff..ff0b68c288 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/TypeInitializer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/TypeInitializer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Test.Common.Models; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/UsefulBuilders.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/UsefulBuilders.cs index cbf24302b4..606d6dbab8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/UsefulBuilders.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TestCommon/UsefulBuilders.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq.Expressions; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TypeHelperTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TypeHelperTest.cs index 2d16918ada..8427fed703 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TypeHelperTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/TypeHelperTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/UnicodeCharactersTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/UnicodeCharactersTest.cs index 0c755ac0f3..570661d534 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/UnicodeCharactersTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/UnicodeCharactersTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/packages.config b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/packages.config index d15f80e9ca..550d6c1717 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/packages.config +++ b/test/UnitTest/Microsoft.AspNet.OData.Test.Shared/packages.config @@ -38,7 +38,7 @@ - + diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ControllerDescriptorFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ControllerDescriptorFactory.cs index 2d063632a4..4b34b708af 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ControllerDescriptorFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ControllerDescriptorFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/DependencyInjectionHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/DependencyInjectionHelper.cs index f28839a135..31b43bb2b3 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/DependencyInjectionHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/DependencyInjectionHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/FormatterTestHelper.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/FormatterTestHelper.cs index fa79bdd361..0c494c65f2 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/FormatterTestHelper.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/FormatterTestHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/HttpRouteCollectionExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/HttpRouteCollectionExtensions.cs index d5fae50bff..200b8638c6 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/HttpRouteCollectionExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/HttpRouteCollectionExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/MockContainer.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/MockContainer.cs index c4661d21c6..e3e7b362ef 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/MockContainer.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/MockContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataConventionModelBuilderFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataConventionModelBuilderFactory.cs index 0627d73f91..42bb14745d 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataConventionModelBuilderFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataConventionModelBuilderFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; using Microsoft.AspNet.OData.Builder; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataDeserializerProviderFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataDeserializerProviderFactory.cs index eb768bd35c..73bdbb80d4 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataDeserializerProviderFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataDeserializerProviderFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Formatter.Deserialization; using Microsoft.Extensions.DependencyInjection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataSerializerContextFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataSerializerContextFactory.cs index 8d6d43172b..dc903a0f2e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataSerializerContextFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataSerializerContextFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using Microsoft.AspNet.OData.Formatter.Serialization; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataSerializerProviderFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataSerializerProviderFactory.cs index 926124a026..290a898982 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataSerializerProviderFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ODataSerializerProviderFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Formatter.Serialization; using Microsoft.Extensions.DependencyInjection; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/RequestFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/RequestFactory.cs index affd45d0a6..8f1ca5cf61 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/RequestFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/RequestFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using System.Web.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ResourceSetContextFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ResourceSetContextFactory.cs index 7c534dc5e0..2cb39e9c99 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ResourceSetContextFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ResourceSetContextFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using Microsoft.AspNet.OData; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ResponseFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ResponseFactory.cs index aa6eb7b491..36f4753d05 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ResponseFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ResponseFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/RoutingConfigurationFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/RoutingConfigurationFactory.cs index eb874c0d5e..0e7e73999f 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/RoutingConfigurationFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/RoutingConfigurationFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Web.Http; @@ -81,4 +85,4 @@ internal static HttpConfiguration CreateWithRootContainerAndTypes(string routeNa return configuration; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ServerFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ServerFactory.cs index d7c0d64da3..5575b6a9bd 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ServerFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/ServerFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestAssemblyResolver.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestAssemblyResolver.cs index a74479dabf..2147d90be5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestAssemblyResolver.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestAssemblyResolver.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestNonODataController.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestNonODataController.cs index c9308ec3fc..b2da772fc5 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestNonODataController.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestNonODataController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Web.Http; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestODataController.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestODataController.cs index ce49a73872..dd2439af4e 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestODataController.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/TestODataController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/WebApiAssembliesResolverFactory.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/WebApiAssembliesResolverFactory.cs index dca16d0cea..c732e961cf 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/WebApiAssembliesResolverFactory.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Abstraction/WebApiAssembliesResolverFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Reflection; using System.Web.Http.Dispatcher; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Extensions/HttpRequestExtensions.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/Extensions/HttpRequestExtensions.cs index 71b86d184a..4e522284a8 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Extensions/HttpRequestExtensions.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Extensions/HttpRequestExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using Microsoft.AspNet.OData.Extensions; diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/Microsoft.AspNet.OData.Test.csproj b/test/UnitTest/Microsoft.AspNet.OData.Test/Microsoft.AspNet.OData.Test.csproj index ab259554dd..52f9d4174a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/Microsoft.AspNet.OData.Test.csproj +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/Microsoft.AspNet.OData.Test.csproj @@ -24,14 +24,14 @@ True - - ..\..\..\sln\packages\Microsoft.OData.Core.7.9.0\lib\net45\Microsoft.OData.Core.dll + + ..\..\..\sln\packages\Microsoft.OData.Core.7.9.1\lib\net45\Microsoft.OData.Core.dll - - ..\..\..\sln\packages\Microsoft.OData.Edm.7.9.0\lib\net45\Microsoft.OData.Edm.dll + + ..\..\..\sln\packages\Microsoft.OData.Edm.7.9.1\lib\net45\Microsoft.OData.Edm.dll - - ..\..\..\sln\packages\Microsoft.Spatial.7.9.0\lib\net45\Microsoft.Spatial.dll + + ..\..\..\sln\packages\Microsoft.Spatial.7.9.1\lib\net45\Microsoft.Spatial.dll ..\..\..\sln\packages\Moq.4.7.137\lib\net45\Moq.dll @@ -53,7 +53,6 @@ - diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/Microsoft.AspNet.OData.PublicApi.bsl b/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/Microsoft.AspNet.OData.PublicApi.bsl index 24aa0e43ef..84b1a5199a 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/Microsoft.AspNet.OData.PublicApi.bsl +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/Microsoft.AspNet.OData.PublicApi.bsl @@ -15,6 +15,12 @@ public enum Microsoft.AspNet.OData.EdmDeltaEntityKind : int { Unknown = 4 } +public enum Microsoft.AspNet.OData.ODataAPIResponseStatus : int { + Failure = 1 + NotFound = 2 + Success = 0 +} + public interface Microsoft.AspNet.OData.IDelta { void Clear () System.Collections.Generic.IEnumerable`1[[System.String]] GetChangedPropertyNames () @@ -24,6 +30,21 @@ public interface Microsoft.AspNet.OData.IDelta { bool TrySetPropertyValue (string name, object value) } +public interface Microsoft.AspNet.OData.IDeltaDeletedEntityObject { + System.Uri Id { public abstract get; public abstract set; } + Microsoft.OData.Edm.IEdmNavigationSource NavigationSource { public abstract get; public abstract set; } + System.Nullable`1[[Microsoft.OData.DeltaDeletedEntryReason]] Reason { public abstract get; public abstract set; } +} + +public interface Microsoft.AspNet.OData.IDeltaSet { +} + +public interface Microsoft.AspNet.OData.IDeltaSetItem { + EdmDeltaEntityKind DeltaKind { public abstract get; } + ODataIdContainer ODataIdContainer { public abstract get; public abstract set; } + IODataInstanceAnnotationContainer TransientInstanceAnnotationContainer { public abstract get; public abstract set; } +} + public interface Microsoft.AspNet.OData.IEdmChangedObject : IEdmObject, IEdmStructuredObject { EdmDeltaEntityKind DeltaKind { public abstract get; } } @@ -62,6 +83,9 @@ public interface Microsoft.AspNet.OData.IEdmStructuredObject : IEdmObject { bool TryGetPropertyValue (string propertyName, out System.Object& value) } +public interface Microsoft.AspNet.OData.IODataAPIHandler { +} + public interface Microsoft.AspNet.OData.IPerRouteContainer { System.Func`1[[Microsoft.OData.IContainerBuilder]] BuilderFactory { public abstract get; public abstract set; } @@ -88,6 +112,15 @@ public abstract class Microsoft.AspNet.OData.Delta : System.Dynamic.DynamicObjec public abstract bool TrySetPropertyValue (string name, object value) } +public abstract class Microsoft.AspNet.OData.EdmODataAPIHandler { + protected EdmODataAPIHandler () + + public abstract EdmODataAPIHandler GetNestedHandler (IEdmStructuredObject parent, string navigationPropertyName) + public abstract ODataAPIResponseStatus TryCreate (IEdmChangedObject changedObject, out IEdmStructuredObject& createdObject, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryDelete (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryGet (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out IEdmStructuredObject& originalObject, out System.String& errorMessage) +} + [ NonValidatingParameterBindingAttribute(), ] @@ -110,6 +143,21 @@ public abstract class Microsoft.AspNet.OData.EdmStructuredObject : Delta, IDynam public virtual bool TrySetPropertyValue (string name, object value) } +public abstract class Microsoft.AspNet.OData.ODataAPIHandler`1 : IODataAPIHandler { + protected ODataAPIHandler`1 () + + public abstract IODataAPIHandler GetNestedHandler (TStructuralType parent, string navigationPropertyName) + public abstract ODataAPIResponseStatus TryCreate (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out TStructuralType& createdObject, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryDelete (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryGet (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out TStructuralType& originalObject, out System.String& errorMessage) +} + +public abstract class Microsoft.AspNet.OData.ODataAPIHandlerFactory { + protected ODataAPIHandlerFactory () + + public abstract IODataAPIHandler GetHandler (NavigationPath navigationPath) +} + [ ODataFormattingAttribute(), ODataRoutingAttribute(), @@ -123,6 +171,12 @@ public abstract class Microsoft.AspNet.OData.ODataController : System.Web.Http.A protected virtual UpdatedODataResult`1 Updated (TEntity entity) } +public abstract class Microsoft.AspNet.OData.ODataEdmAPIHandlerFactory { + protected ODataEdmAPIHandlerFactory () + + public abstract EdmODataAPIHandler GetHandler (NavigationPath navigationPath) +} + [ DataContractAttribute(), ] @@ -250,14 +304,19 @@ public class Microsoft.AspNet.OData.DefaultContainerBuilder : IContainerBuilder [ NonValidatingParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.Delta`1 : TypedDelta, IDynamicMetaObjectProvider, IDelta { +public class Microsoft.AspNet.OData.Delta`1 : TypedDelta, IDynamicMetaObjectProvider, IDelta, IDeltaSetItem { public Delta`1 () public Delta`1 (System.Type structuralType) public Delta`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties) public Delta`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo) + public Delta`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + EdmDeltaEntityKind DeltaKind { public virtual get; protected set; } System.Type ExpectedClrType { public virtual get; } + ODataIdContainer ODataIdContainer { public virtual get; public virtual set; } System.Type StructuredType { public virtual get; } + IODataInstanceAnnotationContainer TransientInstanceAnnotationContainer { public virtual get; public virtual set; } + System.Collections.Generic.IList`1[[System.String]] UpdatableProperties { public get; } public virtual void Clear () public void CopyChangedValues (TStructuralType original) @@ -266,12 +325,40 @@ public class Microsoft.AspNet.OData.Delta`1 : TypedDelta, IDynamicMetaObjectProv public TStructuralType GetInstance () public virtual System.Collections.Generic.IEnumerable`1[[System.String]] GetUnchangedPropertyNames () public void Patch (TStructuralType original) + public void Patch (TStructuralType original, ODataAPIHandlerFactory apiHandlerFactory) public void Put (TStructuralType original) public virtual bool TryGetPropertyType (string name, out System.Type& type) public virtual bool TryGetPropertyValue (string name, out System.Object& value) public virtual bool TrySetPropertyValue (string name, object value) } +[ +NonValidatingParameterBindingAttribute(), +] +public class Microsoft.AspNet.OData.DeltaDeletedEntityObject`1 : Delta`1, IDynamicMetaObjectProvider, IDelta, IDeltaDeletedEntityObject, IDeltaSetItem { + public DeltaDeletedEntityObject`1 () + public DeltaDeletedEntityObject`1 (System.Type structuralType) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + + System.Uri Id { public virtual get; public virtual set; } + Microsoft.OData.Edm.IEdmNavigationSource NavigationSource { public virtual get; public virtual set; } + System.Nullable`1[[Microsoft.OData.DeltaDeletedEntryReason]] Reason { public virtual get; public virtual set; } +} + +[ +NonValidatingParameterBindingAttribute(), +] +public class Microsoft.AspNet.OData.DeltaSet`1 : System.Collections.ObjectModel.Collection`1[[Microsoft.AspNet.OData.IDeltaSetItem]], ICollection, IEnumerable, IList, IDeltaSet, ICollection`1, IEnumerable`1, IList`1, IReadOnlyCollection`1, IReadOnlyList`1 { + public DeltaSet`1 (System.Collections.Generic.IList`1[[System.String]] keys) + + protected virtual void InsertItem (int index, IDeltaSetItem item) + public DeltaSet`1 Patch (ICollection`1 originalCollection) + public DeltaSet`1 Patch (ODataAPIHandlerFactory apiHandlerFactory) +} + [ NonValidatingParameterBindingAttribute(), ] @@ -279,7 +366,10 @@ public class Microsoft.AspNet.OData.EdmChangedObjectCollection : System.Collecti public EdmChangedObjectCollection (Microsoft.OData.Edm.IEdmEntityType entityType) public EdmChangedObjectCollection (Microsoft.OData.Edm.IEdmEntityType entityType, System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.IEdmChangedObject]] changedObjectList) + Microsoft.OData.Edm.IEdmEntityType EntityType { public get; } + public virtual Microsoft.OData.Edm.IEdmTypeReference GetEdmType () + public EdmChangedObjectCollection Patch (ODataEdmAPIHandlerFactory apiHandlerFactory) } [ @@ -367,10 +457,17 @@ public class Microsoft.AspNet.OData.EdmDeltaLink : EdmEntityObject, IDynamicMeta [ NonValidatingParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.EdmEntityObject : EdmStructuredObject, IDynamicMetaObjectProvider, IDelta, IEdmEntityObject, IEdmObject, IEdmStructuredObject { +public class Microsoft.AspNet.OData.EdmEntityObject : EdmStructuredObject, IDynamicMetaObjectProvider, IDelta, IEdmChangedObject, IEdmEntityObject, IEdmObject, IEdmStructuredObject { public EdmEntityObject (Microsoft.OData.Edm.IEdmEntityType edmType) public EdmEntityObject (Microsoft.OData.Edm.IEdmEntityTypeReference edmType) public EdmEntityObject (Microsoft.OData.Edm.IEdmEntityType edmType, bool isNullable) + + EdmDeltaEntityKind DeltaKind { public virtual get; } + ODataIdContainer ODataIdContainer { public get; public set; } + IODataInstanceAnnotationContainer PersistentInstanceAnnotationsContainer { public get; public set; } + + public void AddDataException (Org.OData.Core.V1.DataModificationExceptionType dataModificationException) + public Org.OData.Core.V1.DataModificationExceptionType GetDataException () } [ @@ -460,6 +557,15 @@ public class Microsoft.AspNet.OData.MetadataController : ODataController, IDispo public Microsoft.OData.ODataServiceDocument GetServiceDocument () } +public class Microsoft.AspNet.OData.NavigationPath { + public NavigationPath () + public NavigationPath (string navigationPath, System.Collections.ObjectModel.ReadOnlyCollection`1[[Microsoft.OData.UriParser.ODataPathSegment]] pathSegments) + + string NavigationPathName { public get; } + + public PathItem[] GetNavigationPathItems () +} + public class Microsoft.AspNet.OData.NullEdmComplexObject : IEdmComplexObject, IEdmObject, IEdmStructuredObject { public NullEdmComplexObject (Microsoft.OData.Edm.IEdmComplexTypeReference edmType) @@ -552,6 +658,15 @@ public class Microsoft.AspNet.OData.PageResult`1 : PageResult, IEnumerable`1, IE System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () } +public class Microsoft.AspNet.OData.PathItem { + public PathItem () + + string CastTypeName { public get; } + bool IsCastType { public get; } + System.Collections.Generic.Dictionary`2[[System.String],[System.Object]] KeyProperties { public get; } + string Name { public get; } +} + public class Microsoft.AspNet.OData.PerRouteContainer : PerRouteContainerBase, IPerRouteContainer { public PerRouteContainer (System.Web.Http.HttpConfiguration configuration) @@ -640,6 +755,12 @@ public sealed class Microsoft.AspNet.OData.FromODataUriAttribute : System.Web.Ht public virtual System.Web.Http.Controllers.HttpParameterBinding GetBinding (System.Web.Http.Controllers.HttpParameterDescriptor parameter) } +public sealed class Microsoft.AspNet.OData.ODataIdContainer { + public ODataIdContainer () + + NavigationPath ODataIdNavigationPath { public get; public set; } +} + [ AttributeUsageAttribute(), ] @@ -3134,6 +3255,39 @@ public sealed class Microsoft.AspNet.OData.Routing.ODataRoutePrefixAttribute : S string Prefix { public get; } } +public enum Org.OData.Core.V1.DataModificationOperationKind : int { + Delete = 3 + Insert = 0 + Invoke = 4 + Link = 5 + Unlink = 6 + Update = 1 + Upsert = 2 +} + +public abstract class Org.OData.Core.V1.ExceptionType { + protected ExceptionType () + + Org.OData.Core.V1.MessageType MessageType { public get; public set; } +} + +public class Org.OData.Core.V1.DataModificationExceptionType : Org.OData.Core.V1.ExceptionType { + public DataModificationExceptionType (Org.OData.Core.V1.DataModificationOperationKind failedOperation) + + Org.OData.Core.V1.DataModificationOperationKind FailedOperation { public get; } + short ResponseCode { public get; public set; } +} + +public class Org.OData.Core.V1.MessageType { + public MessageType () + + string Code { public get; public set; } + string Details { public get; public set; } + string Message { public get; public set; } + string Severity { public get; public set; } + string Target { public get; public set; } +} + public abstract class Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeserializer { protected ODataDeserializer (Microsoft.OData.ODataPayloadKind payloadKind) @@ -3168,6 +3322,13 @@ public abstract class Microsoft.AspNet.OData.Formatter.Deserialization.ODataItem Microsoft.OData.ODataItem Item { public get; } } +public abstract class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetWrapperBase : ODataItemBase { + public ODataResourceSetWrapperBase (Microsoft.OData.ODataResourceSetBase item) + + System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper]] Resources { public get; } + Microsoft.OData.ODataResourceSetBase ResourceSetBase { public get; } +} + [ ExtensionAttribute(), ] @@ -3297,7 +3458,11 @@ public class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetDe public virtual System.Threading.Tasks.Task`1[[System.Object]] ReadAsync (Microsoft.OData.ODataMessageReader messageReader, System.Type type, ODataDeserializerContext readContext) public virtual object ReadInline (object item, Microsoft.OData.Edm.IEdmTypeReference edmType, ODataDeserializerContext readContext) - public virtual System.Collections.IEnumerable ReadResourceSet (ODataResourceSetWrapper resourceSet, Microsoft.OData.Edm.IEdmStructuredTypeReference elementType, ODataDeserializerContext readContext) + public virtual System.Collections.IEnumerable ReadResourceSet (ODataResourceSetWrapperBase resourceSet, Microsoft.OData.Edm.IEdmStructuredTypeReference elementType, ODataDeserializerContext readContext) +} + +public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeltaResourceSetWrapper : ODataResourceSetWrapperBase { + public ODataDeltaResourceSetWrapper (Microsoft.OData.ODataDeltaResourceSet item) } public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataNestedResourceInfoWrapper : ODataItemBase { @@ -3307,18 +3472,22 @@ public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataNested Microsoft.OData.ODataNestedResourceInfo NestedResourceInfo { public get; } } -public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetWrapper : ODataItemBase { +public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetWrapper : ODataResourceSetWrapperBase { public ODataResourceSetWrapper (Microsoft.OData.ODataResourceSet item) - System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper]] Resources { public get; } Microsoft.OData.ODataResourceSet ResourceSet { public get; } } public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper : ODataItemBase { - public ODataResourceWrapper (Microsoft.OData.ODataResource item) + public ODataResourceWrapper (Microsoft.OData.ODataResourceBase item) System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.Formatter.Deserialization.ODataNestedResourceInfoWrapper]] NestedResourceInfos { public get; } + [ + ObsoleteAttribute(), + ] Microsoft.OData.ODataResource Resource { public get; } + + Microsoft.OData.ODataResourceBase ResourceBase { public get; } } public abstract class Microsoft.AspNet.OData.Formatter.Serialization.ODataEdmTypeSerializer : ODataSerializer { @@ -3479,8 +3648,9 @@ public class Microsoft.AspNet.OData.Formatter.Serialization.ODataRawValueSeriali public class Microsoft.AspNet.OData.Formatter.Serialization.ODataResourceSerializer : ODataEdmTypeSerializer { public ODataResourceSerializer (ODataSerializerProvider serializerProvider) - public virtual void AppendDynamicProperties (Microsoft.OData.ODataResource resource, SelectExpandNode selectExpandNode, ResourceContext resourceContext) - public virtual void AppendInstanceAnnotations (Microsoft.OData.ODataResource resource, ResourceContext resourceContext) + public virtual void AppendDynamicProperties (Microsoft.OData.ODataResourceBase resource, SelectExpandNode selectExpandNode, ResourceContext resourceContext) + public virtual void AppendInstanceAnnotations (Microsoft.OData.ODataResourceBase resource, ResourceContext resourceContext) + public virtual Microsoft.OData.ODataDeletedResource CreateDeletedResource (SelectExpandNode selectExpandNode, ResourceContext resourceContext) public virtual string CreateETag (ResourceContext resourceContext) public virtual Microsoft.OData.ODataNestedResourceInfo CreateNavigationLink (Microsoft.OData.Edm.IEdmNavigationProperty navigationProperty, ResourceContext resourceContext) public virtual Microsoft.OData.ODataAction CreateODataAction (Microsoft.OData.Edm.IEdmAction action, ResourceContext resourceContext) @@ -3655,6 +3825,7 @@ public class Microsoft.AspNet.OData.Query.Validators.FilterQueryValidator { public virtual void ValidateCollectionResourceCastNode (Microsoft.OData.UriParser.CollectionResourceCastNode collectionResourceCastNode, ODataValidationSettings settings) public virtual void ValidateConstantNode (Microsoft.OData.UriParser.ConstantNode constantNode, ODataValidationSettings settings) public virtual void ValidateConvertNode (Microsoft.OData.UriParser.ConvertNode convertNode, ODataValidationSettings settings) + public virtual void ValidateCountNode (Microsoft.OData.UriParser.CountNode countNode, ODataValidationSettings settings) public virtual void ValidateLogicalOperator (Microsoft.OData.UriParser.BinaryOperatorNode binaryNode, ODataValidationSettings settings) public virtual void ValidateNavigationPropertyNode (Microsoft.OData.UriParser.QueryNode sourceNode, Microsoft.OData.Edm.IEdmNavigationProperty navigationProperty, ODataValidationSettings settings) public virtual void ValidateQueryNode (Microsoft.OData.UriParser.QueryNode node, ODataValidationSettings settings) diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/PublicApiTest.cs b/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/PublicApiTest.cs index fe451ac79f..619f7187dd 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/PublicApiTest.cs +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/PublicApi/PublicApiTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.PublicApi { diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/app.config b/test/UnitTest/Microsoft.AspNet.OData.Test/app.config index 58c01219df..75b71f7c94 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/app.config +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/app.config @@ -1,7 +1,18 @@  + + +
+ - - + + + + + + + \ No newline at end of file diff --git a/test/UnitTest/Microsoft.AspNet.OData.Test/packages.config b/test/UnitTest/Microsoft.AspNet.OData.Test/packages.config index 3753a86fe1..92a62f28e7 100644 --- a/test/UnitTest/Microsoft.AspNet.OData.Test/packages.config +++ b/test/UnitTest/Microsoft.AspNet.OData.Test/packages.config @@ -8,9 +8,9 @@ - - - + + + @@ -38,7 +38,7 @@ - + diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ControllerDescriptorFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ControllerDescriptorFactory.cs index 639b3ddeb5..92b5409405 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ControllerDescriptorFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ControllerDescriptorFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/Endpoint/EndpointRouteBuilderFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/Endpoint/EndpointRouteBuilderFactory.cs index 99dd02fe1d..617d1cf3a6 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/Endpoint/EndpointRouteBuilderFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/Endpoint/EndpointRouteBuilderFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCOREAPP2_0 using System; @@ -65,4 +69,4 @@ public static IEndpointRouteBuilder Create(string routeName, Action +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCOREAPP2_0 using System; @@ -29,4 +33,4 @@ public MockEndpointRouteBuilder(IApplicationBuilder applicationBuilder) public IServiceProvider ServiceProvider => ApplicationBuilder.ApplicationServices; } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/FormatterTestHelper.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/FormatterTestHelper.cs index e1bf445577..d0b87c98b1 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/FormatterTestHelper.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/FormatterTestHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.IO; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/HttpRouteCollectionExtensions.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/HttpRouteCollectionExtensions.cs index 319ed047f7..7c031bcc18 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/HttpRouteCollectionExtensions.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/HttpRouteCollectionExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.Abstraction { diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/MockContainer.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/MockContainer.cs index 05f24da8f3..e7f26d822d 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/MockContainer.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/MockContainer.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataActionSelectorTestHelper.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataActionSelectorTestHelper.cs index 942e655225..c0fc6a0760 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataActionSelectorTestHelper.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataActionSelectorTestHelper.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using System.Reflection; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataConventionModelBuilderFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataConventionModelBuilderFactory.cs index d7ff31e665..40fb5fb345 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataConventionModelBuilderFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataConventionModelBuilderFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Diagnostics; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataDeserializerProviderFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataDeserializerProviderFactory.cs index eb768bd35c..73bdbb80d4 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataDeserializerProviderFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataDeserializerProviderFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Formatter.Deserialization; using Microsoft.Extensions.DependencyInjection; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataSerializerContextFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataSerializerContextFactory.cs index 29ffab054c..ca74c4227c 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataSerializerContextFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataSerializerContextFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Formatter.Serialization; using Microsoft.AspNet.OData.Routing; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataSerializerProviderFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataSerializerProviderFactory.cs index 926124a026..290a898982 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataSerializerProviderFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ODataSerializerProviderFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Formatter.Serialization; using Microsoft.Extensions.DependencyInjection; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/RequestFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/RequestFactory.cs index b2d35e075a..9b61db05ad 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/RequestFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/RequestFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Linq; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ResourceSetContextFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ResourceSetContextFactory.cs index 38a186643e..3f673850c9 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ResourceSetContextFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ResourceSetContextFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData; using Microsoft.AspNetCore.Http; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ResponseFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ResponseFactory.cs index 15d4fcb9c3..0fe2ffc224 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ResponseFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ResponseFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.IO; using System.Net; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/RoutingConfigurationFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/RoutingConfigurationFactory.cs index c05e31f981..8fcfba8dc9 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/RoutingConfigurationFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/RoutingConfigurationFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; @@ -231,4 +235,4 @@ public Task RouteAsync(RouteContext context) return Task.CompletedTask; } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ServerFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ServerFactory.cs index 4f75faf0e4..839665b6d3 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ServerFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/ServerFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestActionDescriptorCollectionProvider.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestActionDescriptorCollectionProvider.cs index 496c0336fe..195787d71a 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestActionDescriptorCollectionProvider.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestActionDescriptorCollectionProvider.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Collections.Generic; using Microsoft.AspNetCore.Mvc.Abstractions; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestNonODataController.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestNonODataController.cs index c2f77c8c2d..fed7f41895 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestNonODataController.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestNonODataController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNetCore.Mvc; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestODataController.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestODataController.cs index 9dda290f29..efc4956179 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestODataController.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/TestODataController.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/WebApiAssembliesResolverFactory.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/WebApiAssembliesResolverFactory.cs index 7275cccf06..2692d690e3 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/WebApiAssembliesResolverFactory.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Abstraction/WebApiAssembliesResolverFactory.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Adapters; using Microsoft.AspNet.OData.Interfaces; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Batch/ODataBatchHttpRequestMessageExtensionsTest.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Batch/ODataBatchHttpRequestMessageExtensionsTest.cs index 11cee4750e..2eef478347 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Batch/ODataBatchHttpRequestMessageExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Batch/ODataBatchHttpRequestMessageExtensionsTest.cs @@ -1,4 +1,11 @@ -using System; +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ + +using System; using System.Linq; using System.Net; using System.Net.Http; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Batch/ODataBatchPathMappingTest.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Batch/ODataBatchPathMappingTest.cs index b43e66c766..b4e8fe13af 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Batch/ODataBatchPathMappingTest.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Batch/ODataBatchPathMappingTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net.Http; using Microsoft.AspNet.OData.Batch; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ActionDescriptorExtensionsTest.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ActionDescriptorExtensionsTest.cs index 27f4a57406..903d8e8f9f 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ActionDescriptorExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ActionDescriptorExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Threading.Tasks; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointLinkGeneratorTests.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointLinkGeneratorTests.cs index 0167f5ae62..b730aa7d12 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointLinkGeneratorTests.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointLinkGeneratorTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCOREAPP2_0 using System; @@ -183,4 +187,4 @@ public void BindPrefixTemplateWithGuidParameterWorksAsExpected(string prefix, st } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointPatternTests.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointPatternTests.cs index 709e1611c5..8f188def51 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointPatternTests.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointPatternTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCOREAPP2_0 using System; @@ -57,4 +61,4 @@ public void GetODataRouteInfoWorksAsExpected(string routeKey, string routeValue, } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointRouteValueTransformerTests.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointRouteValueTransformerTests.cs index f5e8d66767..6a2cec0ea4 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointRouteValueTransformerTests.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointRouteValueTransformerTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCOREAPP2_0 using System; @@ -223,4 +227,4 @@ public ActionDescriptor SelectBestCandidate(RouteContext context, IReadOnlyList< } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointSelectorPolicyTests.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointSelectorPolicyTests.cs index c2abba015f..aed364310f 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointSelectorPolicyTests.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/Endpoint/ODataEndpointSelectorPolicyTests.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ #if !NETCOREAPP2_0 using System; @@ -139,4 +143,4 @@ private static CandidateSet CreateCandidateSet(object metadata = null) } } } -#endif \ No newline at end of file +#endif diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/HttpRequestExtensions.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/HttpRequestExtensions.cs index 477c35f255..7c2a8a8cd1 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/HttpRequestExtensions.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/HttpRequestExtensions.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System.Net; using Microsoft.AspNet.OData.Extensions; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/HttpRequestExtensionsTest.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/HttpRequestExtensionsTest.cs index 2d321141e0..805557ace6 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/HttpRequestExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/HttpRequestExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Extensions; using Microsoft.AspNet.OData.Test.Abstraction; @@ -83,4 +87,4 @@ public void GetNextPageLink_UsesCorrectPortWhenSpecified(string requestUri, int Assert.Equal(nextPageUri, nextPageLink.AbsoluteUri); } } -} \ No newline at end of file +} diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ODataApplicationBuilderExtensionsTest.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ODataApplicationBuilderExtensionsTest.cs index 08aa18e4b3..3a43cd73d9 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ODataApplicationBuilderExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ODataApplicationBuilderExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using Microsoft.AspNet.OData.Common; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ODataConfigurationExtensionsTest.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ODataConfigurationExtensionsTest.cs index 5e716dadf3..9967ad4d81 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ODataConfigurationExtensionsTest.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Extensions/ODataConfigurationExtensionsTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using Microsoft.AspNet.OData.Extensions; using Microsoft.Extensions.DependencyInjection; diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Microsoft.AspNetCore.OData.Test.csproj b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Microsoft.AspNetCore.OData.Test.csproj index 20585573e8..0cb0521b8a 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Microsoft.AspNetCore.OData.Test.csproj +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Microsoft.AspNetCore.OData.Test.csproj @@ -16,9 +16,9 @@ - - - + + + @@ -33,9 +33,9 @@ - - - + + + @@ -60,4 +60,8 @@ + + + + diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore.OData.PublicApi.bsl b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore.OData.PublicApi.bsl index 700c7801da..8da87de03b 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore.OData.PublicApi.bsl +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore.OData.PublicApi.bsl @@ -15,6 +15,12 @@ public enum Microsoft.AspNet.OData.EdmDeltaEntityKind : int { Unknown = 4 } +public enum Microsoft.AspNet.OData.ODataAPIResponseStatus : int { + Failure = 1 + NotFound = 2 + Success = 0 +} + public interface Microsoft.AspNet.OData.IDelta { void Clear () System.Collections.Generic.IEnumerable`1[[System.String]] GetChangedPropertyNames () @@ -24,6 +30,21 @@ public interface Microsoft.AspNet.OData.IDelta { bool TrySetPropertyValue (string name, object value) } +public interface Microsoft.AspNet.OData.IDeltaDeletedEntityObject { + System.Uri Id { public abstract get; public abstract set; } + Microsoft.OData.Edm.IEdmNavigationSource NavigationSource { public abstract get; public abstract set; } + System.Nullable`1[[Microsoft.OData.DeltaDeletedEntryReason]] Reason { public abstract get; public abstract set; } +} + +public interface Microsoft.AspNet.OData.IDeltaSet { +} + +public interface Microsoft.AspNet.OData.IDeltaSetItem { + EdmDeltaEntityKind DeltaKind { public abstract get; } + ODataIdContainer ODataIdContainer { public abstract get; public abstract set; } + IODataInstanceAnnotationContainer TransientInstanceAnnotationContainer { public abstract get; public abstract set; } +} + public interface Microsoft.AspNet.OData.IEdmChangedObject : IEdmObject, IEdmStructuredObject { EdmDeltaEntityKind DeltaKind { public abstract get; } } @@ -62,6 +83,9 @@ public interface Microsoft.AspNet.OData.IEdmStructuredObject : IEdmObject { bool TryGetPropertyValue (string propertyName, out System.Object& value) } +public interface Microsoft.AspNet.OData.IODataAPIHandler { +} + public interface Microsoft.AspNet.OData.IPerRouteContainer { System.Func`1[[Microsoft.OData.IContainerBuilder]] BuilderFactory { public abstract get; public abstract set; } @@ -88,6 +112,15 @@ public abstract class Microsoft.AspNet.OData.Delta : System.Dynamic.DynamicObjec public abstract bool TrySetPropertyValue (string name, object value) } +public abstract class Microsoft.AspNet.OData.EdmODataAPIHandler { + protected EdmODataAPIHandler () + + public abstract EdmODataAPIHandler GetNestedHandler (IEdmStructuredObject parent, string navigationPropertyName) + public abstract ODataAPIResponseStatus TryCreate (IEdmChangedObject changedObject, out IEdmStructuredObject& createdObject, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryDelete (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryGet (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out IEdmStructuredObject& originalObject, out System.String& errorMessage) +} + [ NonValidatingParameterBindingAttribute(), ] @@ -110,6 +143,21 @@ public abstract class Microsoft.AspNet.OData.EdmStructuredObject : Delta, IDynam public virtual bool TrySetPropertyValue (string name, object value) } +public abstract class Microsoft.AspNet.OData.ODataAPIHandler`1 : IODataAPIHandler { + protected ODataAPIHandler`1 () + + public abstract IODataAPIHandler GetNestedHandler (TStructuralType parent, string navigationPropertyName) + public abstract ODataAPIResponseStatus TryCreate (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out TStructuralType& createdObject, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryDelete (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryGet (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out TStructuralType& originalObject, out System.String& errorMessage) +} + +public abstract class Microsoft.AspNet.OData.ODataAPIHandlerFactory { + protected ODataAPIHandlerFactory () + + public abstract IODataAPIHandler GetHandler (NavigationPath navigationPath) +} + [ ODataFormattingAttribute(), ODataRoutingAttribute(), @@ -130,6 +178,12 @@ public abstract class Microsoft.AspNet.OData.ODataController : Microsoft.AspNetC protected virtual UpdatedODataResult`1 Updated (TEntity entity) } +public abstract class Microsoft.AspNet.OData.ODataEdmAPIHandlerFactory { + protected ODataEdmAPIHandlerFactory () + + public abstract EdmODataAPIHandler GetHandler (NavigationPath navigationPath) +} + [ DataContractAttribute(), ] @@ -265,14 +319,19 @@ public class Microsoft.AspNet.OData.DefaultContainerBuilder : IContainerBuilder [ NonValidatingParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.Delta`1 : TypedDelta, IDynamicMetaObjectProvider, IDelta { +public class Microsoft.AspNet.OData.Delta`1 : TypedDelta, IDynamicMetaObjectProvider, IDelta, IDeltaSetItem { public Delta`1 () public Delta`1 (System.Type structuralType) public Delta`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties) public Delta`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo) + public Delta`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + EdmDeltaEntityKind DeltaKind { public virtual get; protected set; } System.Type ExpectedClrType { public virtual get; } + ODataIdContainer ODataIdContainer { public virtual get; public virtual set; } System.Type StructuredType { public virtual get; } + IODataInstanceAnnotationContainer TransientInstanceAnnotationContainer { public virtual get; public virtual set; } + System.Collections.Generic.IList`1[[System.String]] UpdatableProperties { public get; } public virtual void Clear () public void CopyChangedValues (TStructuralType original) @@ -281,12 +340,40 @@ public class Microsoft.AspNet.OData.Delta`1 : TypedDelta, IDynamicMetaObjectProv public TStructuralType GetInstance () public virtual System.Collections.Generic.IEnumerable`1[[System.String]] GetUnchangedPropertyNames () public void Patch (TStructuralType original) + public void Patch (TStructuralType original, ODataAPIHandlerFactory apiHandlerFactory) public void Put (TStructuralType original) public virtual bool TryGetPropertyType (string name, out System.Type& type) public virtual bool TryGetPropertyValue (string name, out System.Object& value) public virtual bool TrySetPropertyValue (string name, object value) } +[ +NonValidatingParameterBindingAttribute(), +] +public class Microsoft.AspNet.OData.DeltaDeletedEntityObject`1 : Delta`1, IDynamicMetaObjectProvider, IDelta, IDeltaDeletedEntityObject, IDeltaSetItem { + public DeltaDeletedEntityObject`1 () + public DeltaDeletedEntityObject`1 (System.Type structuralType) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + + System.Uri Id { public virtual get; public virtual set; } + Microsoft.OData.Edm.IEdmNavigationSource NavigationSource { public virtual get; public virtual set; } + System.Nullable`1[[Microsoft.OData.DeltaDeletedEntryReason]] Reason { public virtual get; public virtual set; } +} + +[ +NonValidatingParameterBindingAttribute(), +] +public class Microsoft.AspNet.OData.DeltaSet`1 : System.Collections.ObjectModel.Collection`1[[Microsoft.AspNet.OData.IDeltaSetItem]], ICollection, IEnumerable, IList, IDeltaSet, ICollection`1, IEnumerable`1, IList`1, IReadOnlyCollection`1, IReadOnlyList`1 { + public DeltaSet`1 (System.Collections.Generic.IList`1[[System.String]] keys) + + protected virtual void InsertItem (int index, IDeltaSetItem item) + public DeltaSet`1 Patch (ICollection`1 originalCollection) + public DeltaSet`1 Patch (ODataAPIHandlerFactory apiHandlerFactory) +} + [ NonValidatingParameterBindingAttribute(), ] @@ -294,7 +381,10 @@ public class Microsoft.AspNet.OData.EdmChangedObjectCollection : System.Collecti public EdmChangedObjectCollection (Microsoft.OData.Edm.IEdmEntityType entityType) public EdmChangedObjectCollection (Microsoft.OData.Edm.IEdmEntityType entityType, System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.IEdmChangedObject]] changedObjectList) + Microsoft.OData.Edm.IEdmEntityType EntityType { public get; } + public virtual Microsoft.OData.Edm.IEdmTypeReference GetEdmType () + public EdmChangedObjectCollection Patch (ODataEdmAPIHandlerFactory apiHandlerFactory) } [ @@ -382,10 +472,17 @@ public class Microsoft.AspNet.OData.EdmDeltaLink : EdmEntityObject, IDynamicMeta [ NonValidatingParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.EdmEntityObject : EdmStructuredObject, IDynamicMetaObjectProvider, IDelta, IEdmEntityObject, IEdmObject, IEdmStructuredObject { +public class Microsoft.AspNet.OData.EdmEntityObject : EdmStructuredObject, IDynamicMetaObjectProvider, IDelta, IEdmChangedObject, IEdmEntityObject, IEdmObject, IEdmStructuredObject { public EdmEntityObject (Microsoft.OData.Edm.IEdmEntityType edmType) public EdmEntityObject (Microsoft.OData.Edm.IEdmEntityTypeReference edmType) public EdmEntityObject (Microsoft.OData.Edm.IEdmEntityType edmType, bool isNullable) + + EdmDeltaEntityKind DeltaKind { public virtual get; } + ODataIdContainer ODataIdContainer { public get; public set; } + IODataInstanceAnnotationContainer PersistentInstanceAnnotationsContainer { public get; public set; } + + public void AddDataException (Org.OData.Core.V1.DataModificationExceptionType dataModificationException) + public Org.OData.Core.V1.DataModificationExceptionType GetDataException () } [ @@ -477,6 +574,15 @@ public class Microsoft.AspNet.OData.MetadataController : ODataController { public Microsoft.OData.ODataServiceDocument GetServiceDocument () } +public class Microsoft.AspNet.OData.NavigationPath { + public NavigationPath () + public NavigationPath (string navigationPath, System.Collections.ObjectModel.ReadOnlyCollection`1[[Microsoft.OData.UriParser.ODataPathSegment]] pathSegments) + + string NavigationPathName { public get; } + + public PathItem[] GetNavigationPathItems () +} + public class Microsoft.AspNet.OData.NullEdmComplexObject : IEdmComplexObject, IEdmObject, IEdmStructuredObject { public NullEdmComplexObject (Microsoft.OData.Edm.IEdmComplexTypeReference edmType) @@ -612,6 +718,15 @@ public class Microsoft.AspNet.OData.PageResult`1 : PageResult, IEnumerable`1, IE System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () } +public class Microsoft.AspNet.OData.PathItem { + public PathItem () + + string CastTypeName { public get; } + bool IsCastType { public get; } + System.Collections.Generic.Dictionary`2[[System.String],[System.Object]] KeyProperties { public get; } + string Name { public get; } +} + public class Microsoft.AspNet.OData.PerRouteContainer : PerRouteContainerBase, IPerRouteContainer { public PerRouteContainer () @@ -689,6 +804,15 @@ public class Microsoft.AspNet.OData.UnqualifiedCallAndEnumPrefixFreeResolver : M public virtual System.Collections.Generic.IEnumerable`1[[Microsoft.OData.Edm.IEdmOperation]] ResolveUnboundOperations (Microsoft.OData.Edm.IEdmModel model, string identifier) } +[ +AttributeUsageAttribute(), +] +public sealed class Microsoft.AspNet.OData.EnableNestedPathsAttribute : Microsoft.AspNetCore.Mvc.Filters.ActionFilterAttribute, IActionFilter, IAsyncActionFilter, IAsyncResultFilter, IFilterMetadata, IOrderedFilter, IResultFilter { + public EnableNestedPathsAttribute () + + public virtual void OnActionExecuted (Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext actionExecutedContext) +} + [ AttributeUsageAttribute(), ] @@ -696,6 +820,12 @@ public sealed class Microsoft.AspNet.OData.FromODataUriAttribute : Microsoft.Asp public FromODataUriAttribute () } +public sealed class Microsoft.AspNet.OData.ODataIdContainer { + public ODataIdContainer () + + NavigationPath ODataIdNavigationPath { public get; public set; } +} + [ AttributeUsageAttribute(), ] @@ -3339,6 +3469,39 @@ public sealed class Microsoft.AspNet.OData.Routing.ODataRoutePrefixAttribute : S string Prefix { public get; } } +public enum Org.OData.Core.V1.DataModificationOperationKind : int { + Delete = 3 + Insert = 0 + Invoke = 4 + Link = 5 + Unlink = 6 + Update = 1 + Upsert = 2 +} + +public abstract class Org.OData.Core.V1.ExceptionType { + protected ExceptionType () + + Org.OData.Core.V1.MessageType MessageType { public get; public set; } +} + +public class Org.OData.Core.V1.DataModificationExceptionType : Org.OData.Core.V1.ExceptionType { + public DataModificationExceptionType (Org.OData.Core.V1.DataModificationOperationKind failedOperation) + + Org.OData.Core.V1.DataModificationOperationKind FailedOperation { public get; } + short ResponseCode { public get; public set; } +} + +public class Org.OData.Core.V1.MessageType { + public MessageType () + + string Code { public get; public set; } + string Details { public get; public set; } + string Message { public get; public set; } + string Severity { public get; public set; } + string Target { public get; public set; } +} + public abstract class Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeserializer { protected ODataDeserializer (Microsoft.OData.ODataPayloadKind payloadKind) @@ -3373,6 +3536,13 @@ public abstract class Microsoft.AspNet.OData.Formatter.Deserialization.ODataItem Microsoft.OData.ODataItem Item { public get; } } +public abstract class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetWrapperBase : ODataItemBase { + public ODataResourceSetWrapperBase (Microsoft.OData.ODataResourceSetBase item) + + System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper]] Resources { public get; } + Microsoft.OData.ODataResourceSetBase ResourceSetBase { public get; } +} + [ ExtensionAttribute(), ] @@ -3501,7 +3671,11 @@ public class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetDe public virtual System.Threading.Tasks.Task`1[[System.Object]] ReadAsync (Microsoft.OData.ODataMessageReader messageReader, System.Type type, ODataDeserializerContext readContext) public virtual object ReadInline (object item, Microsoft.OData.Edm.IEdmTypeReference edmType, ODataDeserializerContext readContext) - public virtual System.Collections.IEnumerable ReadResourceSet (ODataResourceSetWrapper resourceSet, Microsoft.OData.Edm.IEdmStructuredTypeReference elementType, ODataDeserializerContext readContext) + public virtual System.Collections.IEnumerable ReadResourceSet (ODataResourceSetWrapperBase resourceSet, Microsoft.OData.Edm.IEdmStructuredTypeReference elementType, ODataDeserializerContext readContext) +} + +public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeltaResourceSetWrapper : ODataResourceSetWrapperBase { + public ODataDeltaResourceSetWrapper (Microsoft.OData.ODataDeltaResourceSet item) } public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataNestedResourceInfoWrapper : ODataItemBase { @@ -3511,18 +3685,22 @@ public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataNested Microsoft.OData.ODataNestedResourceInfo NestedResourceInfo { public get; } } -public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetWrapper : ODataItemBase { +public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetWrapper : ODataResourceSetWrapperBase { public ODataResourceSetWrapper (Microsoft.OData.ODataResourceSet item) - System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper]] Resources { public get; } Microsoft.OData.ODataResourceSet ResourceSet { public get; } } public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper : ODataItemBase { - public ODataResourceWrapper (Microsoft.OData.ODataResource item) + public ODataResourceWrapper (Microsoft.OData.ODataResourceBase item) System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.Formatter.Deserialization.ODataNestedResourceInfoWrapper]] NestedResourceInfos { public get; } + [ + ObsoleteAttribute(), + ] Microsoft.OData.ODataResource Resource { public get; } + + Microsoft.OData.ODataResourceBase ResourceBase { public get; } } public abstract class Microsoft.AspNet.OData.Formatter.Serialization.ODataEdmTypeSerializer : ODataSerializer { @@ -3683,8 +3861,9 @@ public class Microsoft.AspNet.OData.Formatter.Serialization.ODataRawValueSeriali public class Microsoft.AspNet.OData.Formatter.Serialization.ODataResourceSerializer : ODataEdmTypeSerializer { public ODataResourceSerializer (ODataSerializerProvider serializerProvider) - public virtual void AppendDynamicProperties (Microsoft.OData.ODataResource resource, SelectExpandNode selectExpandNode, ResourceContext resourceContext) - public virtual void AppendInstanceAnnotations (Microsoft.OData.ODataResource resource, ResourceContext resourceContext) + public virtual void AppendDynamicProperties (Microsoft.OData.ODataResourceBase resource, SelectExpandNode selectExpandNode, ResourceContext resourceContext) + public virtual void AppendInstanceAnnotations (Microsoft.OData.ODataResourceBase resource, ResourceContext resourceContext) + public virtual Microsoft.OData.ODataDeletedResource CreateDeletedResource (SelectExpandNode selectExpandNode, ResourceContext resourceContext) public virtual string CreateETag (ResourceContext resourceContext) public virtual Microsoft.OData.ODataNestedResourceInfo CreateNavigationLink (Microsoft.OData.Edm.IEdmNavigationProperty navigationProperty, ResourceContext resourceContext) public virtual Microsoft.OData.ODataAction CreateODataAction (Microsoft.OData.Edm.IEdmAction action, ResourceContext resourceContext) @@ -3858,6 +4037,7 @@ public class Microsoft.AspNet.OData.Query.Validators.FilterQueryValidator { public virtual void ValidateCollectionResourceCastNode (Microsoft.OData.UriParser.CollectionResourceCastNode collectionResourceCastNode, ODataValidationSettings settings) public virtual void ValidateConstantNode (Microsoft.OData.UriParser.ConstantNode constantNode, ODataValidationSettings settings) public virtual void ValidateConvertNode (Microsoft.OData.UriParser.ConvertNode convertNode, ODataValidationSettings settings) + public virtual void ValidateCountNode (Microsoft.OData.UriParser.CountNode countNode, ODataValidationSettings settings) public virtual void ValidateLogicalOperator (Microsoft.OData.UriParser.BinaryOperatorNode binaryNode, ODataValidationSettings settings) public virtual void ValidateNavigationPropertyNode (Microsoft.OData.UriParser.QueryNode sourceNode, Microsoft.OData.Edm.IEdmNavigationProperty navigationProperty, ODataValidationSettings settings) public virtual void ValidateQueryNode (Microsoft.OData.UriParser.QueryNode node, ODataValidationSettings settings) @@ -3974,6 +4154,12 @@ public class Microsoft.AspNet.OData.Routing.Conventions.NavigationRoutingConvent public virtual string SelectAction (Microsoft.AspNetCore.Routing.RouteContext routeContext, SelectControllerResult controllerResult, System.Collections.Generic.IEnumerable`1[[Microsoft.AspNetCore.Mvc.Controllers.ControllerActionDescriptor]] actionDescriptors) } +public class Microsoft.AspNet.OData.Routing.Conventions.NestedPathsRoutingConvention : NavigationSourceRoutingConvention, IODataRoutingConvention { + public NestedPathsRoutingConvention () + + public virtual string SelectAction (Microsoft.AspNetCore.Routing.RouteContext routeContext, SelectControllerResult controllerResult, System.Collections.Generic.IEnumerable`1[[Microsoft.AspNetCore.Mvc.Controllers.ControllerActionDescriptor]] actionDescriptors) +} + public class Microsoft.AspNet.OData.Routing.Conventions.OperationImportRoutingConvention : NavigationSourceRoutingConvention, IODataRoutingConvention { public OperationImportRoutingConvention () diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore3x.OData.PublicApi.bsl b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore3x.OData.PublicApi.bsl index fb3aedfe11..dc1e769162 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore3x.OData.PublicApi.bsl +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/Microsoft.AspNetCore3x.OData.PublicApi.bsl @@ -15,6 +15,12 @@ public enum Microsoft.AspNet.OData.EdmDeltaEntityKind : int { Unknown = 4 } +public enum Microsoft.AspNet.OData.ODataAPIResponseStatus : int { + Failure = 1 + NotFound = 2 + Success = 0 +} + public interface Microsoft.AspNet.OData.IDelta { void Clear () System.Collections.Generic.IEnumerable`1[[System.String]] GetChangedPropertyNames () @@ -24,6 +30,21 @@ public interface Microsoft.AspNet.OData.IDelta { bool TrySetPropertyValue (string name, object value) } +public interface Microsoft.AspNet.OData.IDeltaDeletedEntityObject { + System.Uri Id { public abstract get; public abstract set; } + Microsoft.OData.Edm.IEdmNavigationSource NavigationSource { public abstract get; public abstract set; } + System.Nullable`1[[Microsoft.OData.DeltaDeletedEntryReason]] Reason { public abstract get; public abstract set; } +} + +public interface Microsoft.AspNet.OData.IDeltaSet { +} + +public interface Microsoft.AspNet.OData.IDeltaSetItem { + EdmDeltaEntityKind DeltaKind { public abstract get; } + ODataIdContainer ODataIdContainer { public abstract get; public abstract set; } + IODataInstanceAnnotationContainer TransientInstanceAnnotationContainer { public abstract get; public abstract set; } +} + public interface Microsoft.AspNet.OData.IEdmChangedObject : IEdmObject, IEdmStructuredObject { EdmDeltaEntityKind DeltaKind { public abstract get; } } @@ -62,6 +83,9 @@ public interface Microsoft.AspNet.OData.IEdmStructuredObject : IEdmObject { bool TryGetPropertyValue (string propertyName, out System.Object& value) } +public interface Microsoft.AspNet.OData.IODataAPIHandler { +} + public interface Microsoft.AspNet.OData.IPerRouteContainer { System.Func`1[[Microsoft.OData.IContainerBuilder]] BuilderFactory { public abstract get; public abstract set; } @@ -88,6 +112,15 @@ public abstract class Microsoft.AspNet.OData.Delta : System.Dynamic.DynamicObjec public abstract bool TrySetPropertyValue (string name, object value) } +public abstract class Microsoft.AspNet.OData.EdmODataAPIHandler { + protected EdmODataAPIHandler () + + public abstract EdmODataAPIHandler GetNestedHandler (IEdmStructuredObject parent, string navigationPropertyName) + public abstract ODataAPIResponseStatus TryCreate (IEdmChangedObject changedObject, out IEdmStructuredObject& createdObject, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryDelete (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryGet (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out IEdmStructuredObject& originalObject, out System.String& errorMessage) +} + [ NonValidatingParameterBindingAttribute(), ] @@ -110,6 +143,21 @@ public abstract class Microsoft.AspNet.OData.EdmStructuredObject : Delta, IDynam public virtual bool TrySetPropertyValue (string name, object value) } +public abstract class Microsoft.AspNet.OData.ODataAPIHandler`1 : IODataAPIHandler { + protected ODataAPIHandler`1 () + + public abstract IODataAPIHandler GetNestedHandler (TStructuralType parent, string navigationPropertyName) + public abstract ODataAPIResponseStatus TryCreate (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out TStructuralType& createdObject, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryDelete (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out System.String& errorMessage) + public abstract ODataAPIResponseStatus TryGet (System.Collections.Generic.IDictionary`2[[System.String],[System.Object]] keyValues, out TStructuralType& originalObject, out System.String& errorMessage) +} + +public abstract class Microsoft.AspNet.OData.ODataAPIHandlerFactory { + protected ODataAPIHandlerFactory () + + public abstract IODataAPIHandler GetHandler (NavigationPath navigationPath) +} + [ ODataFormattingAttribute(), ODataRoutingAttribute(), @@ -134,6 +182,12 @@ public abstract class Microsoft.AspNet.OData.ODataController : Microsoft.AspNetC protected virtual UpdatedODataResult`1 Updated (TEntity entity) } +public abstract class Microsoft.AspNet.OData.ODataEdmAPIHandlerFactory { + protected ODataEdmAPIHandlerFactory () + + public abstract EdmODataAPIHandler GetHandler (NavigationPath navigationPath) +} + [ DataContractAttribute(), ] @@ -269,14 +323,19 @@ public class Microsoft.AspNet.OData.DefaultContainerBuilder : IContainerBuilder [ NonValidatingParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.Delta`1 : TypedDelta, IDynamicMetaObjectProvider, IDelta { +public class Microsoft.AspNet.OData.Delta`1 : TypedDelta, IDynamicMetaObjectProvider, IDelta, IDeltaSetItem { public Delta`1 () public Delta`1 (System.Type structuralType) public Delta`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties) public Delta`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo) + public Delta`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + EdmDeltaEntityKind DeltaKind { public virtual get; protected set; } System.Type ExpectedClrType { public virtual get; } + ODataIdContainer ODataIdContainer { public virtual get; public virtual set; } System.Type StructuredType { public virtual get; } + IODataInstanceAnnotationContainer TransientInstanceAnnotationContainer { public virtual get; public virtual set; } + System.Collections.Generic.IList`1[[System.String]] UpdatableProperties { public get; } public virtual void Clear () public void CopyChangedValues (TStructuralType original) @@ -285,12 +344,40 @@ public class Microsoft.AspNet.OData.Delta`1 : TypedDelta, IDynamicMetaObjectProv public TStructuralType GetInstance () public virtual System.Collections.Generic.IEnumerable`1[[System.String]] GetUnchangedPropertyNames () public void Patch (TStructuralType original) + public void Patch (TStructuralType original, ODataAPIHandlerFactory apiHandlerFactory) public void Put (TStructuralType original) public virtual bool TryGetPropertyType (string name, out System.Type& type) public virtual bool TryGetPropertyValue (string name, out System.Object& value) public virtual bool TrySetPropertyValue (string name, object value) } +[ +NonValidatingParameterBindingAttribute(), +] +public class Microsoft.AspNet.OData.DeltaDeletedEntityObject`1 : Delta`1, IDynamicMetaObjectProvider, IDelta, IDeltaDeletedEntityObject, IDeltaSetItem { + public DeltaDeletedEntityObject`1 () + public DeltaDeletedEntityObject`1 (System.Type structuralType) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + public DeltaDeletedEntityObject`1 (System.Type structuralType, System.Collections.Generic.IEnumerable`1[[System.String]] updatableProperties, System.Reflection.PropertyInfo dynamicDictionaryPropertyInfo, System.Reflection.PropertyInfo instanceAnnotationsPropertyInfo) + + System.Uri Id { public virtual get; public virtual set; } + Microsoft.OData.Edm.IEdmNavigationSource NavigationSource { public virtual get; public virtual set; } + System.Nullable`1[[Microsoft.OData.DeltaDeletedEntryReason]] Reason { public virtual get; public virtual set; } +} + +[ +NonValidatingParameterBindingAttribute(), +] +public class Microsoft.AspNet.OData.DeltaSet`1 : System.Collections.ObjectModel.Collection`1[[Microsoft.AspNet.OData.IDeltaSetItem]], ICollection, IEnumerable, IList, IDeltaSet, ICollection`1, IEnumerable`1, IList`1, IReadOnlyCollection`1, IReadOnlyList`1 { + public DeltaSet`1 (System.Collections.Generic.IList`1[[System.String]] keys) + + protected virtual void InsertItem (int index, IDeltaSetItem item) + public DeltaSet`1 Patch (ICollection`1 originalCollection) + public DeltaSet`1 Patch (ODataAPIHandlerFactory apiHandlerFactory) +} + [ NonValidatingParameterBindingAttribute(), ] @@ -298,7 +385,10 @@ public class Microsoft.AspNet.OData.EdmChangedObjectCollection : System.Collecti public EdmChangedObjectCollection (Microsoft.OData.Edm.IEdmEntityType entityType) public EdmChangedObjectCollection (Microsoft.OData.Edm.IEdmEntityType entityType, System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.IEdmChangedObject]] changedObjectList) + Microsoft.OData.Edm.IEdmEntityType EntityType { public get; } + public virtual Microsoft.OData.Edm.IEdmTypeReference GetEdmType () + public EdmChangedObjectCollection Patch (ODataEdmAPIHandlerFactory apiHandlerFactory) } [ @@ -386,10 +476,17 @@ public class Microsoft.AspNet.OData.EdmDeltaLink : EdmEntityObject, IDynamicMeta [ NonValidatingParameterBindingAttribute(), ] -public class Microsoft.AspNet.OData.EdmEntityObject : EdmStructuredObject, IDynamicMetaObjectProvider, IDelta, IEdmEntityObject, IEdmObject, IEdmStructuredObject { +public class Microsoft.AspNet.OData.EdmEntityObject : EdmStructuredObject, IDynamicMetaObjectProvider, IDelta, IEdmChangedObject, IEdmEntityObject, IEdmObject, IEdmStructuredObject { public EdmEntityObject (Microsoft.OData.Edm.IEdmEntityType edmType) public EdmEntityObject (Microsoft.OData.Edm.IEdmEntityTypeReference edmType) public EdmEntityObject (Microsoft.OData.Edm.IEdmEntityType edmType, bool isNullable) + + EdmDeltaEntityKind DeltaKind { public virtual get; } + ODataIdContainer ODataIdContainer { public get; public set; } + IODataInstanceAnnotationContainer PersistentInstanceAnnotationsContainer { public get; public set; } + + public void AddDataException (Org.OData.Core.V1.DataModificationExceptionType dataModificationException) + public Org.OData.Core.V1.DataModificationExceptionType GetDataException () } [ @@ -481,6 +578,15 @@ public class Microsoft.AspNet.OData.MetadataController : ODataController { public Microsoft.OData.ODataServiceDocument GetServiceDocument () } +public class Microsoft.AspNet.OData.NavigationPath { + public NavigationPath () + public NavigationPath (string navigationPath, System.Collections.ObjectModel.ReadOnlyCollection`1[[Microsoft.OData.UriParser.ODataPathSegment]] pathSegments) + + string NavigationPathName { public get; } + + public PathItem[] GetNavigationPathItems () +} + public class Microsoft.AspNet.OData.NullEdmComplexObject : IEdmComplexObject, IEdmObject, IEdmStructuredObject { public NullEdmComplexObject (Microsoft.OData.Edm.IEdmComplexTypeReference edmType) @@ -616,6 +722,15 @@ public class Microsoft.AspNet.OData.PageResult`1 : PageResult, IEnumerable`1, IE System.Collections.IEnumerator System.Collections.IEnumerable.GetEnumerator () } +public class Microsoft.AspNet.OData.PathItem { + public PathItem () + + string CastTypeName { public get; } + bool IsCastType { public get; } + System.Collections.Generic.Dictionary`2[[System.String],[System.Object]] KeyProperties { public get; } + string Name { public get; } +} + public class Microsoft.AspNet.OData.PerRouteContainer : PerRouteContainerBase, IPerRouteContainer { public PerRouteContainer () @@ -693,6 +808,15 @@ public class Microsoft.AspNet.OData.UnqualifiedCallAndEnumPrefixFreeResolver : M public virtual System.Collections.Generic.IEnumerable`1[[Microsoft.OData.Edm.IEdmOperation]] ResolveUnboundOperations (Microsoft.OData.Edm.IEdmModel model, string identifier) } +[ +AttributeUsageAttribute(), +] +public sealed class Microsoft.AspNet.OData.EnableNestedPathsAttribute : Microsoft.AspNetCore.Mvc.Filters.ActionFilterAttribute, IActionFilter, IAsyncActionFilter, IAsyncResultFilter, IFilterMetadata, IOrderedFilter, IResultFilter { + public EnableNestedPathsAttribute () + + public virtual void OnActionExecuted (Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext actionExecutedContext) +} + [ AttributeUsageAttribute(), ] @@ -700,6 +824,12 @@ public sealed class Microsoft.AspNet.OData.FromODataUriAttribute : Microsoft.Asp public FromODataUriAttribute () } +public sealed class Microsoft.AspNet.OData.ODataIdContainer { + public ODataIdContainer () + + NavigationPath ODataIdNavigationPath { public get; public set; } +} + [ AttributeUsageAttribute(), ] @@ -3538,6 +3668,39 @@ public sealed class Microsoft.AspNet.OData.Routing.ODataRoutePrefixAttribute : S string Prefix { public get; } } +public enum Org.OData.Core.V1.DataModificationOperationKind : int { + Delete = 3 + Insert = 0 + Invoke = 4 + Link = 5 + Unlink = 6 + Update = 1 + Upsert = 2 +} + +public abstract class Org.OData.Core.V1.ExceptionType { + protected ExceptionType () + + Org.OData.Core.V1.MessageType MessageType { public get; public set; } +} + +public class Org.OData.Core.V1.DataModificationExceptionType : Org.OData.Core.V1.ExceptionType { + public DataModificationExceptionType (Org.OData.Core.V1.DataModificationOperationKind failedOperation) + + Org.OData.Core.V1.DataModificationOperationKind FailedOperation { public get; } + short ResponseCode { public get; public set; } +} + +public class Org.OData.Core.V1.MessageType { + public MessageType () + + string Code { public get; public set; } + string Details { public get; public set; } + string Message { public get; public set; } + string Severity { public get; public set; } + string Target { public get; public set; } +} + public abstract class Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeserializer { protected ODataDeserializer (Microsoft.OData.ODataPayloadKind payloadKind) @@ -3572,6 +3735,13 @@ public abstract class Microsoft.AspNet.OData.Formatter.Deserialization.ODataItem Microsoft.OData.ODataItem Item { public get; } } +public abstract class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetWrapperBase : ODataItemBase { + public ODataResourceSetWrapperBase (Microsoft.OData.ODataResourceSetBase item) + + System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper]] Resources { public get; } + Microsoft.OData.ODataResourceSetBase ResourceSetBase { public get; } +} + [ ExtensionAttribute(), ] @@ -3700,7 +3870,11 @@ public class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetDe public virtual System.Threading.Tasks.Task`1[[System.Object]] ReadAsync (Microsoft.OData.ODataMessageReader messageReader, System.Type type, ODataDeserializerContext readContext) public virtual object ReadInline (object item, Microsoft.OData.Edm.IEdmTypeReference edmType, ODataDeserializerContext readContext) - public virtual System.Collections.IEnumerable ReadResourceSet (ODataResourceSetWrapper resourceSet, Microsoft.OData.Edm.IEdmStructuredTypeReference elementType, ODataDeserializerContext readContext) + public virtual System.Collections.IEnumerable ReadResourceSet (ODataResourceSetWrapperBase resourceSet, Microsoft.OData.Edm.IEdmStructuredTypeReference elementType, ODataDeserializerContext readContext) +} + +public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataDeltaResourceSetWrapper : ODataResourceSetWrapperBase { + public ODataDeltaResourceSetWrapper (Microsoft.OData.ODataDeltaResourceSet item) } public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataNestedResourceInfoWrapper : ODataItemBase { @@ -3710,18 +3884,22 @@ public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataNested Microsoft.OData.ODataNestedResourceInfo NestedResourceInfo { public get; } } -public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetWrapper : ODataItemBase { +public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceSetWrapper : ODataResourceSetWrapperBase { public ODataResourceSetWrapper (Microsoft.OData.ODataResourceSet item) - System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper]] Resources { public get; } Microsoft.OData.ODataResourceSet ResourceSet { public get; } } public sealed class Microsoft.AspNet.OData.Formatter.Deserialization.ODataResourceWrapper : ODataItemBase { - public ODataResourceWrapper (Microsoft.OData.ODataResource item) + public ODataResourceWrapper (Microsoft.OData.ODataResourceBase item) System.Collections.Generic.IList`1[[Microsoft.AspNet.OData.Formatter.Deserialization.ODataNestedResourceInfoWrapper]] NestedResourceInfos { public get; } + [ + ObsoleteAttribute(), + ] Microsoft.OData.ODataResource Resource { public get; } + + Microsoft.OData.ODataResourceBase ResourceBase { public get; } } public abstract class Microsoft.AspNet.OData.Formatter.Serialization.ODataEdmTypeSerializer : ODataSerializer { @@ -3882,8 +4060,9 @@ public class Microsoft.AspNet.OData.Formatter.Serialization.ODataRawValueSeriali public class Microsoft.AspNet.OData.Formatter.Serialization.ODataResourceSerializer : ODataEdmTypeSerializer { public ODataResourceSerializer (ODataSerializerProvider serializerProvider) - public virtual void AppendDynamicProperties (Microsoft.OData.ODataResource resource, SelectExpandNode selectExpandNode, ResourceContext resourceContext) - public virtual void AppendInstanceAnnotations (Microsoft.OData.ODataResource resource, ResourceContext resourceContext) + public virtual void AppendDynamicProperties (Microsoft.OData.ODataResourceBase resource, SelectExpandNode selectExpandNode, ResourceContext resourceContext) + public virtual void AppendInstanceAnnotations (Microsoft.OData.ODataResourceBase resource, ResourceContext resourceContext) + public virtual Microsoft.OData.ODataDeletedResource CreateDeletedResource (SelectExpandNode selectExpandNode, ResourceContext resourceContext) public virtual string CreateETag (ResourceContext resourceContext) public virtual Microsoft.OData.ODataNestedResourceInfo CreateNavigationLink (Microsoft.OData.Edm.IEdmNavigationProperty navigationProperty, ResourceContext resourceContext) public virtual Microsoft.OData.ODataAction CreateODataAction (Microsoft.OData.Edm.IEdmAction action, ResourceContext resourceContext) @@ -4057,6 +4236,7 @@ public class Microsoft.AspNet.OData.Query.Validators.FilterQueryValidator { public virtual void ValidateCollectionResourceCastNode (Microsoft.OData.UriParser.CollectionResourceCastNode collectionResourceCastNode, ODataValidationSettings settings) public virtual void ValidateConstantNode (Microsoft.OData.UriParser.ConstantNode constantNode, ODataValidationSettings settings) public virtual void ValidateConvertNode (Microsoft.OData.UriParser.ConvertNode convertNode, ODataValidationSettings settings) + public virtual void ValidateCountNode (Microsoft.OData.UriParser.CountNode countNode, ODataValidationSettings settings) public virtual void ValidateLogicalOperator (Microsoft.OData.UriParser.BinaryOperatorNode binaryNode, ODataValidationSettings settings) public virtual void ValidateNavigationPropertyNode (Microsoft.OData.UriParser.QueryNode sourceNode, Microsoft.OData.Edm.IEdmNavigationProperty navigationProperty, ODataValidationSettings settings) public virtual void ValidateQueryNode (Microsoft.OData.UriParser.QueryNode node, ODataValidationSettings settings) @@ -4173,6 +4353,12 @@ public class Microsoft.AspNet.OData.Routing.Conventions.NavigationRoutingConvent public virtual string SelectAction (Microsoft.AspNetCore.Routing.RouteContext routeContext, SelectControllerResult controllerResult, System.Collections.Generic.IEnumerable`1[[Microsoft.AspNetCore.Mvc.Controllers.ControllerActionDescriptor]] actionDescriptors) } +public class Microsoft.AspNet.OData.Routing.Conventions.NestedPathsRoutingConvention : NavigationSourceRoutingConvention, IODataRoutingConvention { + public NestedPathsRoutingConvention () + + public virtual string SelectAction (Microsoft.AspNetCore.Routing.RouteContext routeContext, SelectControllerResult controllerResult, System.Collections.Generic.IEnumerable`1[[Microsoft.AspNetCore.Mvc.Controllers.ControllerActionDescriptor]] actionDescriptors) +} + public class Microsoft.AspNet.OData.Routing.Conventions.OperationImportRoutingConvention : NavigationSourceRoutingConvention, IODataRoutingConvention { public OperationImportRoutingConvention () diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/PublicApiTest.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/PublicApiTest.cs index 0633ac43b6..2fa0aaa5f1 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/PublicApiTest.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/PublicApi/PublicApiTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ namespace Microsoft.AspNet.OData.Test.PublicApi { diff --git a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Routing/ODataActionSelectorTest.cs b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Routing/ODataActionSelectorTest.cs index b0ad2874c3..05831409d5 100644 --- a/test/UnitTest/Microsoft.AspNetCore.OData.Test/Routing/ODataActionSelectorTest.cs +++ b/test/UnitTest/Microsoft.AspNetCore.OData.Test/Routing/ODataActionSelectorTest.cs @@ -1,5 +1,9 @@ -// Copyright (c) Microsoft Corporation. All rights reserved. -// Licensed under the MIT License. See License.txt in the project root for license information. +//----------------------------------------------------------------------------- +// +// Copyright (c) .NET Foundation and Contributors. All rights reserved. +// See License.txt in the project root for license information. +// +//------------------------------------------------------------------------------ using System; using System.Collections.Generic; diff --git a/tools/GetNugetPackageMetadata.proj b/tools/GetNugetPackageMetadata.proj index d215916741..723a88ffb3 100644 --- a/tools/GetNugetPackageMetadata.proj +++ b/tools/GetNugetPackageMetadata.proj @@ -7,7 +7,6 @@ - @@ -15,4 +14,5 @@ + \ No newline at end of file diff --git a/tools/WebStack.versions.settings.targets b/tools/WebStack.versions.settings.targets index 847ef5b0d0..33f1f899b6 100644 --- a/tools/WebStack.versions.settings.targets +++ b/tools/WebStack.versions.settings.targets @@ -4,9 +4,9 @@ 7 - 5 - 8 - + 6 + 0 + beta @@ -15,7 +15,7 @@ [2.0.0, 3.0.0) 1.0.0 2.0.0 - [7.8.2, 8.0.0) + [7.9.0, 8.0.0) 10.0.3 @@ -40,7 +40,7 @@ $(VersionFullSemantic) $(VersionFullSemantic)-$(VersionRelease) - +