Skip to content

Commit 9925c9f

Browse files
author
Chris Martinez
committed
Initial codebase commit
1 parent 22acbde commit 9925c9f

File tree

238 files changed

+15332
-2
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

238 files changed

+15332
-2
lines changed

Diff for: .gitattributes

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
###############################################################################
2+
# Set default behavior to automatically normalize line endings.
3+
###############################################################################
4+
* text=auto
5+
6+
###############################################################################
7+
# Set default behavior for command prompt diff.
8+
#
9+
# This is need for earlier builds of msysgit that does not have it on by
10+
# default for csharp files.
11+
# Note: This is only used by command line
12+
###############################################################################
13+
#*.cs diff=csharp
14+
15+
###############################################################################
16+
# Set the merge driver for project and solution files
17+
#
18+
# Merging from the command prompt will add diff markers to the files if there
19+
# are conflicts (Merging from VS is not affected by the settings below, in VS
20+
# the diff markers are never inserted). Diff markers may cause the following
21+
# file extensions to fail to load in VS. An alternative would be to treat
22+
# these files as binary and thus will always conflict and require user
23+
# intervention with every merge. To do so, just uncomment the entries below
24+
###############################################################################
25+
#*.sln merge=binary
26+
#*.csproj merge=binary
27+
#*.vbproj merge=binary
28+
#*.vcxproj merge=binary
29+
#*.vcproj merge=binary
30+
#*.dbproj merge=binary
31+
#*.fsproj merge=binary
32+
#*.lsproj merge=binary
33+
#*.wixproj merge=binary
34+
#*.modelproj merge=binary
35+
#*.sqlproj merge=binary
36+
#*.wwaproj merge=binary
37+
38+
###############################################################################
39+
# behavior for image files
40+
#
41+
# image files are treated as binary by default.
42+
###############################################################################
43+
#*.jpg binary
44+
#*.png binary
45+
#*.gif binary
46+
47+
###############################################################################
48+
# diff behavior for common document formats
49+
#
50+
# Convert binary document formats to text before diffing them. This feature
51+
# is only available from the command line. Turn it on by uncommenting the
52+
# entries below.
53+
###############################################################################
54+
#*.doc diff=astextplain
55+
#*.DOC diff=astextplain
56+
#*.docx diff=astextplain
57+
#*.DOCX diff=astextplain
58+
#*.dot diff=astextplain
59+
#*.DOT diff=astextplain
60+
#*.pdf diff=astextplain
61+
#*.PDF diff=astextplain
62+
#*.rtf diff=astextplain
63+
#*.RTF diff=astextplain

Diff for: .gitignore

+48
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# ignore visual studio folders and files
2+
*.suo
3+
*.user
4+
*.userosscache
5+
*.sln.docstates
6+
$tf/
7+
.vs/
8+
*.[Cc]ache
9+
!*.[Cc]ache/
10+
_UpgradeReport_Files/
11+
Backup*/
12+
UpgradeLog*.XML
13+
UpgradeLog*.htm
14+
15+
# ignore build outputs
16+
[Dd]ebug/
17+
[Rr]elease/
18+
x64/
19+
x86/
20+
[Bb]in/
21+
[Oo]bj/
22+
[Ff]akes[Aa]ssemblies/
23+
24+
# ignore nuget packages folder
25+
/packages
26+
/NuGet
27+
28+
# ignore generated html files
29+
*.htm
30+
31+
# Visual Studio test runner
32+
[Tt]est[Rr]esult*/
33+
[Ii]ndex.dat
34+
[Ss]torage.dat
35+
36+
# .NET CLI
37+
project.lock.json
38+
artifacts/
39+
40+
# Visual Studio profiler
41+
*.psess
42+
*.vsp
43+
*.vspx
44+
45+
# ReSharper folders and files
46+
_ReSharper*/
47+
*.[Rr]e[Ss]harper
48+
*.DotSettings.user

Diff for: ApiVersioning.sln

+159
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,159 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 14
4+
VisualStudioVersion = 14.0.25420.1
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "src", "src", "{4D5F5F21-0CB7-4B4E-A42F-732BD4AFD0FF}"
7+
EndProject
8+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{2EB04F47-AD85-4169-BA08-9104D9D29332}"
9+
ProjectSection(SolutionItems) = preProject
10+
src\Shared\Arg.cs = src\Shared\Arg.cs
11+
src\Shared\CustomDictionary.xml = src\Shared\CustomDictionary.xml
12+
src\Shared\SharedAssemblyInfo.cs = src\Shared\SharedAssemblyInfo.cs
13+
src\Shared\StringExtensions.cs = src\Shared\StringExtensions.cs
14+
EndProjectSection
15+
EndProject
16+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApi", "src\WebApi\WebApi.xproj", "{3BAC97ED-1A8E-4F5A-A716-DB5255F51C81}"
17+
EndProject
18+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "test", "test", "{0987757E-4D09-4523-B9C9-65B1E8832AA1}"
19+
EndProject
20+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{2957BAF3-9E50-4D82-B732-A34345C4A8F2}"
21+
ProjectSection(SolutionItems) = preProject
22+
.gitattributes = .gitattributes
23+
.gitignore = .gitignore
24+
LICENSE = LICENSE
25+
README.md = README.md
26+
EndProjectSection
27+
EndProject
28+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApi.Tests", "test\WebApi.Tests\WebApi.Tests.xproj", "{AEB074E1-E57A-4DD3-A972-3625B367CE5D}"
29+
EndProject
30+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Core", "src\Core\Core.xproj", "{C39CCCBC-6B04-406F-96BE-CA796EFF34C5}"
31+
EndProject
32+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{261B77B4-647B-4459-9FE8-4EFF910B28D0}"
33+
ProjectSection(SolutionItems) = preProject
34+
src\Common\AdvertiseApiVersionsAttribute.cs = src\Common\AdvertiseApiVersionsAttribute.cs
35+
src\Common\ApiVersion.cs = src\Common\ApiVersion.cs
36+
src\Common\ApiVersionAttribute.cs = src\Common\ApiVersionAttribute.cs
37+
src\Common\ApiVersionNeutralAttribute.cs = src\Common\ApiVersionNeutralAttribute.cs
38+
src\Common\CollectionExtensions.cs = src\Common\CollectionExtensions.cs
39+
src\Common\ControllerNameAttribute.cs = src\Common\ControllerNameAttribute.cs
40+
src\Common\MapToApiVersionAttribute.cs = src\Common\MapToApiVersionAttribute.cs
41+
src\Common\ReportApiVersionsAttribute.cs = src\Common\ReportApiVersionsAttribute.cs
42+
src\Common\TypeExtensions.cs = src\Common\TypeExtensions.cs
43+
EndProjectSection
44+
EndProject
45+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Versioning", "Versioning", "{DE4EE45F-F8EA-4B32-B16F-441F946ACEF4}"
46+
ProjectSection(SolutionItems) = preProject
47+
src\Common\Versioning\ApiVersioningOptions.cs = src\Common\Versioning\ApiVersioningOptions.cs
48+
src\Common\Versioning\ApiVersionModel.cs = src\Common\Versioning\ApiVersionModel.cs
49+
src\Common\Versioning\ApiVersionModelDebugView.cs = src\Common\Versioning\ApiVersionModelDebugView.cs
50+
src\Common\Versioning\ApiVersionModelExtensions.cs = src\Common\Versioning\ApiVersionModelExtensions.cs
51+
src\Common\Versioning\ApiVersionReader.cs = src\Common\Versioning\ApiVersionReader.cs
52+
src\Common\Versioning\ApiVersionsBaseAttribute.cs = src\Common\Versioning\ApiVersionsBaseAttribute.cs
53+
src\Common\Versioning\AttributeExtensions.cs = src\Common\Versioning\AttributeExtensions.cs
54+
src\Common\Versioning\ConstantApiVersionSelector.cs = src\Common\Versioning\ConstantApiVersionSelector.cs
55+
src\Common\Versioning\CurrentImplementationApiVersionSelector.cs = src\Common\Versioning\CurrentImplementationApiVersionSelector.cs
56+
src\Common\Versioning\DefaultApiVersionSelector.cs = src\Common\Versioning\DefaultApiVersionSelector.cs
57+
src\Common\Versioning\HeaderApiVersionReader.cs = src\Common\Versioning\HeaderApiVersionReader.cs
58+
src\Common\Versioning\IApiVersionNeutral.cs = src\Common\Versioning\IApiVersionNeutral.cs
59+
src\Common\Versioning\IApiVersionProvider.cs = src\Common\Versioning\IApiVersionProvider.cs
60+
src\Common\Versioning\IApiVersionReader.cs = src\Common\Versioning\IApiVersionReader.cs
61+
src\Common\Versioning\IApiVersionSelector.cs = src\Common\Versioning\IApiVersionSelector.cs
62+
src\Common\Versioning\LowestImplementedApiVersionSelector.cs = src\Common\Versioning\LowestImplementedApiVersionSelector.cs
63+
src\Common\Versioning\QueryStringApiVersionReader.cs = src\Common\Versioning\QueryStringApiVersionReader.cs
64+
src\Common\Versioning\QueryStringOrHeaderApiVersionReader.cs = src\Common\Versioning\QueryStringOrHeaderApiVersionReader.cs
65+
EndProjectSection
66+
EndProject
67+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApi.OData", "src\WebApi.OData\WebApi.OData.xproj", "{48A2B488-23AB-4C83-AE30-0B8B735C4562}"
68+
EndProject
69+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "WebApi.OData.Tests", "test\WebApi.OData.Tests\WebApi.OData.Tests.xproj", "{D87E54CC-C2D6-4AE5-806D-AE825B051C66}"
70+
EndProject
71+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "Core.Tests", "test\Core.Tests\Core.Tests.xproj", "{69C59656-53D1-4ACB-92B5-8B34C8E62175}"
72+
EndProject
73+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "samples", "samples", "{915BB224-B1D0-4E27-A348-67FCC77AAA44}"
74+
EndProject
75+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "webapi", "webapi", "{F446ED94-368F-4F67-913B-16E82CA80DFC}"
76+
EndProject
77+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "aspnetcore", "aspnetcore", "{900DD210-8500-4D89-A05D-C9526935A719}"
78+
EndProject
79+
Project("{8BB2217D-0F2D-49D1-97BC-3654ED321F3B}") = "BasicSample", "samples\aspnetcore\BasicSample\BasicSample.xproj", "{59389B47-8280-411E-B840-D097AA1DCDEE}"
80+
EndProject
81+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Common", "Common", "{946F164B-5502-4629-AD75-04DD91D1128F}"
82+
EndProject
83+
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Versioning", "Versioning", "{8D4E3E25-E532-4EF7-A36E-CEEC098C04B1}"
84+
ProjectSection(SolutionItems) = preProject
85+
test\Common\Versioning\ApiVersionModelExtensionsTest.cs = test\Common\Versioning\ApiVersionModelExtensionsTest.cs
86+
test\Common\Versioning\MaxSelectVersionData.cs = test\Common\Versioning\MaxSelectVersionData.cs
87+
test\Common\Versioning\MinSelectVersionData.cs = test\Common\Versioning\MinSelectVersionData.cs
88+
test\Common\Versioning\SelectVersionData.cs = test\Common\Versioning\SelectVersionData.cs
89+
EndProjectSection
90+
EndProject
91+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicWebApiSample", "samples\webapi\BasicWebApiSample\BasicWebApiSample.csproj", "{D1DF9ECC-7D2F-4982-8E45-BD690EF80906}"
92+
EndProject
93+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "BasicODataWebApiSample", "samples\webapi\BasicODataWebApiSample\BasicODataWebApiSample.csproj", "{8C09CD67-5153-413C-B870-2FC7488C2D53}"
94+
EndProject
95+
Global
96+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
97+
Debug|Any CPU = Debug|Any CPU
98+
Release|Any CPU = Release|Any CPU
99+
EndGlobalSection
100+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
101+
{3BAC97ED-1A8E-4F5A-A716-DB5255F51C81}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
102+
{3BAC97ED-1A8E-4F5A-A716-DB5255F51C81}.Debug|Any CPU.Build.0 = Debug|Any CPU
103+
{3BAC97ED-1A8E-4F5A-A716-DB5255F51C81}.Release|Any CPU.ActiveCfg = Release|Any CPU
104+
{3BAC97ED-1A8E-4F5A-A716-DB5255F51C81}.Release|Any CPU.Build.0 = Release|Any CPU
105+
{AEB074E1-E57A-4DD3-A972-3625B367CE5D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
106+
{AEB074E1-E57A-4DD3-A972-3625B367CE5D}.Debug|Any CPU.Build.0 = Debug|Any CPU
107+
{AEB074E1-E57A-4DD3-A972-3625B367CE5D}.Release|Any CPU.ActiveCfg = Release|Any CPU
108+
{AEB074E1-E57A-4DD3-A972-3625B367CE5D}.Release|Any CPU.Build.0 = Release|Any CPU
109+
{C39CCCBC-6B04-406F-96BE-CA796EFF34C5}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
110+
{C39CCCBC-6B04-406F-96BE-CA796EFF34C5}.Debug|Any CPU.Build.0 = Debug|Any CPU
111+
{C39CCCBC-6B04-406F-96BE-CA796EFF34C5}.Release|Any CPU.ActiveCfg = Release|Any CPU
112+
{C39CCCBC-6B04-406F-96BE-CA796EFF34C5}.Release|Any CPU.Build.0 = Release|Any CPU
113+
{48A2B488-23AB-4C83-AE30-0B8B735C4562}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
114+
{48A2B488-23AB-4C83-AE30-0B8B735C4562}.Debug|Any CPU.Build.0 = Debug|Any CPU
115+
{48A2B488-23AB-4C83-AE30-0B8B735C4562}.Release|Any CPU.ActiveCfg = Release|Any CPU
116+
{48A2B488-23AB-4C83-AE30-0B8B735C4562}.Release|Any CPU.Build.0 = Release|Any CPU
117+
{D87E54CC-C2D6-4AE5-806D-AE825B051C66}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
118+
{D87E54CC-C2D6-4AE5-806D-AE825B051C66}.Debug|Any CPU.Build.0 = Debug|Any CPU
119+
{D87E54CC-C2D6-4AE5-806D-AE825B051C66}.Release|Any CPU.ActiveCfg = Release|Any CPU
120+
{D87E54CC-C2D6-4AE5-806D-AE825B051C66}.Release|Any CPU.Build.0 = Release|Any CPU
121+
{69C59656-53D1-4ACB-92B5-8B34C8E62175}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
122+
{69C59656-53D1-4ACB-92B5-8B34C8E62175}.Debug|Any CPU.Build.0 = Debug|Any CPU
123+
{69C59656-53D1-4ACB-92B5-8B34C8E62175}.Release|Any CPU.ActiveCfg = Release|Any CPU
124+
{69C59656-53D1-4ACB-92B5-8B34C8E62175}.Release|Any CPU.Build.0 = Release|Any CPU
125+
{59389B47-8280-411E-B840-D097AA1DCDEE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
126+
{59389B47-8280-411E-B840-D097AA1DCDEE}.Debug|Any CPU.Build.0 = Debug|Any CPU
127+
{59389B47-8280-411E-B840-D097AA1DCDEE}.Release|Any CPU.ActiveCfg = Release|Any CPU
128+
{59389B47-8280-411E-B840-D097AA1DCDEE}.Release|Any CPU.Build.0 = Release|Any CPU
129+
{D1DF9ECC-7D2F-4982-8E45-BD690EF80906}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
130+
{D1DF9ECC-7D2F-4982-8E45-BD690EF80906}.Debug|Any CPU.Build.0 = Debug|Any CPU
131+
{D1DF9ECC-7D2F-4982-8E45-BD690EF80906}.Release|Any CPU.ActiveCfg = Release|Any CPU
132+
{D1DF9ECC-7D2F-4982-8E45-BD690EF80906}.Release|Any CPU.Build.0 = Release|Any CPU
133+
{8C09CD67-5153-413C-B870-2FC7488C2D53}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
134+
{8C09CD67-5153-413C-B870-2FC7488C2D53}.Debug|Any CPU.Build.0 = Debug|Any CPU
135+
{8C09CD67-5153-413C-B870-2FC7488C2D53}.Release|Any CPU.ActiveCfg = Release|Any CPU
136+
{8C09CD67-5153-413C-B870-2FC7488C2D53}.Release|Any CPU.Build.0 = Release|Any CPU
137+
EndGlobalSection
138+
GlobalSection(SolutionProperties) = preSolution
139+
HideSolutionNode = FALSE
140+
EndGlobalSection
141+
GlobalSection(NestedProjects) = preSolution
142+
{2EB04F47-AD85-4169-BA08-9104D9D29332} = {4D5F5F21-0CB7-4B4E-A42F-732BD4AFD0FF}
143+
{3BAC97ED-1A8E-4F5A-A716-DB5255F51C81} = {4D5F5F21-0CB7-4B4E-A42F-732BD4AFD0FF}
144+
{AEB074E1-E57A-4DD3-A972-3625B367CE5D} = {0987757E-4D09-4523-B9C9-65B1E8832AA1}
145+
{C39CCCBC-6B04-406F-96BE-CA796EFF34C5} = {4D5F5F21-0CB7-4B4E-A42F-732BD4AFD0FF}
146+
{261B77B4-647B-4459-9FE8-4EFF910B28D0} = {4D5F5F21-0CB7-4B4E-A42F-732BD4AFD0FF}
147+
{DE4EE45F-F8EA-4B32-B16F-441F946ACEF4} = {261B77B4-647B-4459-9FE8-4EFF910B28D0}
148+
{48A2B488-23AB-4C83-AE30-0B8B735C4562} = {4D5F5F21-0CB7-4B4E-A42F-732BD4AFD0FF}
149+
{D87E54CC-C2D6-4AE5-806D-AE825B051C66} = {0987757E-4D09-4523-B9C9-65B1E8832AA1}
150+
{69C59656-53D1-4ACB-92B5-8B34C8E62175} = {0987757E-4D09-4523-B9C9-65B1E8832AA1}
151+
{F446ED94-368F-4F67-913B-16E82CA80DFC} = {915BB224-B1D0-4E27-A348-67FCC77AAA44}
152+
{900DD210-8500-4D89-A05D-C9526935A719} = {915BB224-B1D0-4E27-A348-67FCC77AAA44}
153+
{59389B47-8280-411E-B840-D097AA1DCDEE} = {900DD210-8500-4D89-A05D-C9526935A719}
154+
{946F164B-5502-4629-AD75-04DD91D1128F} = {0987757E-4D09-4523-B9C9-65B1E8832AA1}
155+
{8D4E3E25-E532-4EF7-A36E-CEEC098C04B1} = {946F164B-5502-4629-AD75-04DD91D1128F}
156+
{D1DF9ECC-7D2F-4982-8E45-BD690EF80906} = {F446ED94-368F-4F67-913B-16E82CA80DFC}
157+
{8C09CD67-5153-413C-B870-2FC7488C2D53} = {F446ED94-368F-4F67-913B-16E82CA80DFC}
158+
EndGlobalSection
159+
EndGlobal

Diff for: LICENSE

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2015 Commonsense Software
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.
22+

Diff for: README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
# aspnet-api-versioning
2-
Provides a set of libraries which add service API versioning to ASP.NET Web API, OData with ASP.NET Web API, and ASP.NET Core.
1+
# ASP.NET API Versioning
2+
Provides a set of libraries which add service API versioning to ASP.NET Web API, OData with ASP.NET Web API, and ASP.NET Core.

Diff for: global.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"projects": [ "src", "test" ]
3+
}

Diff for: samples/aspnetcore/BasicSample/BasicSample.xproj

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">14.0</VisualStudioVersion>
5+
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
6+
</PropertyGroup>
7+
<Import Project="$(VSToolsPath)\DotNet\Microsoft.DotNet.Props" Condition="'$(VSToolsPath)' != ''" />
8+
<PropertyGroup Label="Globals">
9+
<ProjectGuid>59389b47-8280-411e-b840-d097aa1dcdee</ProjectGuid>
10+
<RootNamespace>Microsoft.Examples</RootNamespace>
11+
<BaseIntermediateOutputPath Condition="'$(BaseIntermediateOutputPath)'=='' ">.\obj</BaseIntermediateOutputPath>
12+
<OutputPath Condition="'$(OutputPath)'=='' ">.\bin\</OutputPath>
13+
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
14+
</PropertyGroup>
15+
<PropertyGroup>
16+
<SchemaVersion>2.0</SchemaVersion>
17+
</PropertyGroup>
18+
<Import Project="$(VSToolsPath)\DotNet.Web\Microsoft.DotNet.Web.targets" Condition="'$(VSToolsPath)' != ''" />
19+
</Project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Microsoft.Examples.Controllers
2+
{
3+
using Microsoft.AspNetCore.Mvc;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Threading.Tasks;
8+
9+
[ApiVersion( "1.0" )]
10+
[Route( "api/v{version:apiVersion}/[controller]" )]
11+
public class HelloWorldController : Controller
12+
{
13+
// GET api/v{version}/helloworld
14+
[HttpGet]
15+
public string Get() => $"Controller = {GetType().Name}\nVersion = {HttpContext.GetRequestedApiVersion()}";
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Microsoft.Examples.Controllers
2+
{
3+
using Microsoft.AspNetCore.Mvc;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Threading.Tasks;
8+
9+
[ApiVersion( "2.0" )]
10+
[Route( "api/values" )]
11+
public class Values2Controller : Controller
12+
{
13+
// GET api/values?api-version=2.0
14+
[HttpGet]
15+
public string Get() => $"Controller = {GetType().Name}\nVersion = {HttpContext.GetRequestedApiVersion()}";
16+
}
17+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
namespace Microsoft.Examples.Controllers
2+
{
3+
using Microsoft.AspNetCore.Mvc;
4+
using System;
5+
using System.Collections.Generic;
6+
using System.Linq;
7+
using System.Threading.Tasks;
8+
9+
[ApiVersion( "1.0" )]
10+
[Route( "api/[controller]" )]
11+
public class ValuesController : Controller
12+
{
13+
// GET api/values?api-version-1.0
14+
[HttpGet]
15+
public string Get() => $"Controller = {GetType().Name}\nVersion = {HttpContext.GetRequestedApiVersion()}";
16+
}
17+
}

0 commit comments

Comments
 (0)