实例介绍
【实例简介】
SDammann.WebApi.Versioning提供了一种简单、经过测试且可扩展的方法来为ASP.NET Web API添加版本控制支持。本教程将指导您完成设置过程,并帮助您选择合适的版本控制方案。
首先,需要在依赖容器中注册DefaultControllerIdentificationDetector和DefaultRequestControllerIdentificationDetector类。然后,根据您的需求选择一个版本控制方案并注册。例如,如果您希望通过API路由进行版本控制(这将使用像/api/v1.2/product/这样的URLs),可以在Web API配置代理中包含以下代码:
此外,文章还探讨了API版本控制的几个概念,包括控制器命名/版本控制、外部请求命名/版本控制以及版本本身的定义,并提供了关于自定义异常处理和控制器识别扩展的高级概念。
【实例截图】
【核心代码】
文件清单
└── SDammann.WebApi.Versioning-291b9ad21a68c6dc1fa80e6585ea0a91a057d2bd
├── LICENSE
├── nuget
│ ├── nuget.exe
│ ├── Publish.cmd
│ ├── Readme.txt
│ └── SDammann.WebApi.Versioning.nuspec
├── README.md
└── src
├── packages
│ ├── Microsoft.AspNet.Razor.3.1.2
│ │ └── lib
│ │ └── net45
│ │ ├── System.Web.Razor.dll
│ │ └── System.Web.Razor.xml
│ ├── Microsoft.AspNet.WebApi.Client.5.1.2
│ │ └── lib
│ │ ├── net45
│ │ │ ├── System.Net.Http.Formatting.dll
│ │ │ └── System.Net.Http.Formatting.xml
│ │ └── portable-wp8 netcore45 net45
│ │ ├── System.Net.Http.Formatting.dll
│ │ └── System.Net.Http.Formatting.xml
│ ├── Microsoft.AspNet.WebApi.Core.5.1.2
│ │ ├── Content
│ │ │ └── web.config.transform
│ │ └── lib
│ │ └── net45
│ │ ├── System.Web.Http.dll
│ │ └── System.Web.Http.xml
│ ├── Microsoft.AspNet.WebApi.HelpPage.5.1.2
│ │ └── Content
│ │ └── Areas
│ │ └── HelpPage
│ │ ├── ApiDescriptionExtensions.cs.pp
│ │ ├── App_Start
│ │ │ └── HelpPageConfig.cs.pp
│ │ ├── Controllers
│ │ │ └── HelpController.cs.pp
│ │ ├── HelpPageAreaRegistration.cs.pp
│ │ ├── HelpPageConfigurationExtensions.cs.pp
│ │ ├── HelpPage.css.pp
│ │ ├── ModelDescriptions
│ │ │ ├── CollectionModelDescription.cs.pp
│ │ │ ├── ComplexTypeModelDescription.cs.pp
│ │ │ ├── DictionaryModelDescription.cs.pp
│ │ │ ├── EnumTypeModelDescription.cs.pp
│ │ │ ├── EnumValueDescription.cs.pp
│ │ │ ├── IModelDocumentationProvider.cs.pp
│ │ │ ├── KeyValuePairModelDescription.cs.pp
│ │ │ ├── ModelDescription.cs.pp
│ │ │ ├── ModelDescriptionGenerator.cs.pp
│ │ │ ├── ModelNameAttribute.cs.pp
│ │ │ ├── ModelNameHelper.cs.pp
│ │ │ ├── ParameterAnnotation.cs.pp
│ │ │ ├── ParameterDescription.cs.pp
│ │ │ └── SimpleTypeModelDescription.cs.pp
│ │ ├── Models
│ │ │ └── HelpPageApiModel.cs.pp
│ │ ├── SampleGeneration
│ │ │ ├── HelpPageSampleGenerator.cs.pp
│ │ │ ├── HelpPageSampleKey.cs.pp
│ │ │ ├── ImageSample.cs.pp
│ │ │ ├── InvalidSample.cs.pp
│ │ │ ├── ObjectGenerator.cs.pp
│ │ │ ├── SampleDirection.cs.pp
│ │ │ └── TextSample.cs.pp
│ │ ├── Views
│ │ │ ├── Help
│ │ │ │ ├── Api.cshtml.pp
│ │ │ │ ├── DisplayTemplates
│ │ │ │ │ ├── ApiGroup.cshtml.pp
│ │ │ │ │ ├── CollectionModelDescription.cshtml.pp
│ │ │ │ │ ├── ComplexTypeModelDescription.cshtml.pp
│ │ │ │ │ ├── DictionaryModelDescription.cshtml.pp
│ │ │ │ │ ├── EnumTypeModelDescription.cshtml.pp
│ │ │ │ │ ├── HelpPageApiModel.cshtml.pp
│ │ │ │ │ ├── ImageSample.cshtml.pp
│ │ │ │ │ ├── InvalidSample.cshtml.pp
│ │ │ │ │ ├── KeyValuePairModelDescription.cshtml.pp
│ │ │ │ │ ├── ModelDescriptionLink.cshtml.pp
│ │ │ │ │ ├── Parameters.cshtml.pp
│ │ │ │ │ ├── Samples.cshtml.pp
│ │ │ │ │ ├── SimpleTypeModelDescription.cshtml.pp
│ │ │ │ │ └── TextSample.cshtml.pp
│ │ │ │ ├── Index.cshtml.pp
│ │ │ │ └── ResourceModel.cshtml.pp
│ │ │ ├── Shared
│ │ │ │ └── _Layout.cshtml.pp
│ │ │ ├── _ViewStart.cshtml.pp
│ │ │ └── Web.config
│ │ └── XmlDocumentationProvider.cs.pp
│ ├── Microsoft.AspNet.WebApi.WebHost.5.1.2
│ │ └── lib
│ │ └── net45
│ │ ├── System.Web.Http.WebHost.dll
│ │ └── System.Web.Http.WebHost.xml
│ ├── Microsoft.Web.Infrastructure.1.0.0.0
│ │ └── lib
│ │ └── net40
│ │ └── Microsoft.Web.Infrastructure.dll
│ └── WebApi.DocumentationController.3.2.1.0
│ ├── content
│ │ ├── Content
│ │ │ └── documentation
│ │ │ └── documentation.css
│ │ ├── Scripts
│ │ │ └── documentation.js
│ │ └── Views
│ │ └── Help
│ │ ├── Details.cshtml
│ │ ├── _HelpLayout.cshtml
│ │ ├── Index.cshtml
│ │ └── ModelDiagram.cshtml
│ ├── lib
│ │ └── net45
│ │ ├── WebApi.DocumentationController.dll
│ │ ├── WebApi.DocumentationController.pdb
│ │ └── WebApi.DocumentationController.XML
│ └── tools
│ ├── init.ps1
│ ├── install.ps1
│ └── uninstall.ps1
├── SDammann.WebApi.Versioning
│ ├── ApiVersion.cs
│ ├── app.config
│ ├── Configuration
│ │ ├── ApiVersioningConfiguration.cs
│ │ └── ApiVersioning.cs
│ ├── ControllerIdentification.cs
│ ├── Discovery
│ │ ├── ApiVersionAttribute.cs
│ │ ├── AttributeControllerVersionDetector.cs
│ │ ├── DefaultAttributeControllerVersionDetector.cs
│ │ ├── DefaultControllerIdentificationDetector.cs
│ │ ├── DefaultControllerNameDetector.cs
│ │ ├── DefaultControllerVersionDetector.cs
│ │ ├── IControllerIdentificationDetector.cs
│ │ ├── IControllerNameDetector.cs
│ │ ├── IControllerVersionDetector.cs
│ │ ├── NamespaceControllerVersionDetector.cs
│ │ └── TypeNameControllerNameDetector.cs
│ ├── Documentation
│ │ ├── MultiVersionHttpControllerDescriptor.cs
│ │ └── VersionedApiExplorer.cs
│ ├── ErrorHandling
│ │ ├── AmbigiousApiRequestException.cs
│ │ ├── ApiControllerNotFoundException.cs
│ │ ├── ApiVersioningExceptionHandler.cs
│ │ ├── ApiVersionNotDeterminedException.cs
│ │ ├── BaseApiException.cs
│ │ ├── DefaultVersioningExceptionHandler.cs
│ │ └── IVersioningExceptionHandler.cs
│ ├── ExceptionResources.Designer.cs
│ ├── ExceptionResources.resx
│ ├── Internal
│ │ ├── HttpControllerTypeCache.cs
│ │ └── ServicesExtensions.cs
│ ├── packages.config
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Request
│ │ ├── AcceptHeaderRequestVersionDetector.cs
│ │ ├── ApiVersionFormatException.cs
│ │ ├── DefaultRequestControllerIdentificationDetector.cs
│ │ ├── DefaultRequestControllerNameDetector.cs
│ │ ├── DefaultRouteKeyVersionDetector.cs
│ │ ├── IRequestControllerIdentificationDetector.cs
│ │ ├── IRequestControllerNameDetector.cs
│ │ ├── IRequestVersionDetector.cs
│ │ ├── RouteKeyRequestControllerNameDetector.cs
│ │ └── RouteKeyVersionDetector.cs
│ ├── SDammann.WebApi.Versioning.csproj
│ ├── SemVerApiVersion.cs
│ ├── Signkey.snk
│ ├── UndefinedApiVersion.cs
│ ├── VersionedApiControllerSelector.cs
│ └── VersionedApiExplorer.cs
├── SDammann.WebApi.Versioning.sln
├── SDammann.WebApi.Versioning.TestApi
│ ├── Api
│ │ └── ValuesController.cs
│ ├── App_Start
│ │ ├── BundleConfig.cs
│ │ ├── FilterConfig.cs
│ │ ├── RouteConfig.cs
│ │ └── WebApiConfig.cs
│ ├── Areas
│ │ └── HelpPage
│ │ ├── ApiDescriptionExtensions.cs
│ │ ├── App_Start
│ │ │ └── HelpPageConfig.cs
│ │ ├── Controllers
│ │ │ └── HelpController.cs
│ │ ├── HelpPageAreaRegistration.cs
│ │ ├── HelpPageConfigurationExtensions.cs
│ │ ├── HelpPage.css
│ │ ├── ModelDescriptions
│ │ │ ├── CollectionModelDescription.cs
│ │ │ ├── ComplexTypeModelDescription.cs
│ │ │ ├── DictionaryModelDescription.cs
│ │ │ ├── EnumTypeModelDescription.cs
│ │ │ ├── EnumValueDescription.cs
│ │ │ ├── IModelDocumentationProvider.cs
│ │ │ ├── KeyValuePairModelDescription.cs
│ │ │ ├── ModelDescription.cs
│ │ │ ├── ModelDescriptionGenerator.cs
│ │ │ ├── ModelNameAttribute.cs
│ │ │ ├── ModelNameHelper.cs
│ │ │ ├── ParameterAnnotation.cs
│ │ │ ├── ParameterDescription.cs
│ │ │ └── SimpleTypeModelDescription.cs
│ │ ├── Models
│ │ │ └── HelpPageApiModel.cs
│ │ ├── SampleGeneration
│ │ │ ├── HelpPageSampleGenerator.cs
│ │ │ ├── HelpPageSampleKey.cs
│ │ │ ├── ImageSample.cs
│ │ │ ├── InvalidSample.cs
│ │ │ ├── ObjectGenerator.cs
│ │ │ ├── SampleDirection.cs
│ │ │ └── TextSample.cs
│ │ ├── Views
│ │ │ ├── Help
│ │ │ │ ├── Api.cshtml
│ │ │ │ ├── DisplayTemplates
│ │ │ │ │ ├── ApiGroup.cshtml
│ │ │ │ │ ├── CollectionModelDescription.cshtml
│ │ │ │ │ ├── ComplexTypeModelDescription.cshtml
│ │ │ │ │ ├── DictionaryModelDescription.cshtml
│ │ │ │ │ ├── EnumTypeModelDescription.cshtml
│ │ │ │ │ ├── HelpPageApiModel.cshtml
│ │ │ │ │ ├── ImageSample.cshtml
│ │ │ │ │ ├── InvalidSample.cshtml
│ │ │ │ │ ├── KeyValuePairModelDescription.cshtml
│ │ │ │ │ ├── ModelDescriptionLink.cshtml
│ │ │ │ │ ├── Parameters.cshtml
│ │ │ │ │ ├── Samples.cshtml
│ │ │ │ │ ├── SimpleTypeModelDescription.cshtml
│ │ │ │ │ └── TextSample.cshtml
│ │ │ │ ├── Index.cshtml
│ │ │ │ └── ResourceModel.cshtml
│ │ │ ├── Shared
│ │ │ │ └── _Layout.cshtml
│ │ │ ├── _ViewStart.cshtml
│ │ │ └── Web.config
│ │ └── XmlDocumentationProvider.cs
│ ├── Content
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ ├── bootstrap.min.css
│ │ └── Site.css
│ ├── Controllers
│ │ └── HomeController.cs
│ ├── favicon.ico
│ ├── Global.asax
│ ├── Global.asax.cs
│ ├── packages.config
│ ├── Project_Readme.html
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Scripts
│ │ └── _references.js
│ ├── SDammann.WebApi.Versioning.TestApi.csproj
│ ├── Startup.cs
│ ├── TinyIoC.cs
│ ├── Views
│ │ ├── Home
│ │ │ └── Index.cshtml
│ │ ├── Shared
│ │ │ ├── Error.cshtml
│ │ │ └── _Layout.cshtml
│ │ ├── _ViewStart.cshtml
│ │ └── Web.config
│ ├── Web.config
│ ├── Web.Debug.config
│ └── Web.Release.config
└── SDammann.WebApi.Versioning.Tests
├── app.config
├── Discovery
│ ├── DefaultAttributeControllerVersionDetector.cs
│ ├── NamespaceControllerVersionDetectorTests.cs
│ └── TypeNameControllerNameDetectorTests.cs
├── Integration
│ ├── Controllers
│ │ ├── Version1
│ │ │ └── HelloController.cs
│ │ └── Version2_5
│ │ └── HelloController.cs
│ ├── DefaultSettingsIntegrationTest.cs
│ └── IntegrationTestManager.cs
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
├── Request
│ ├── RouteKeyRequestControllerNameDetectorTests.cs
│ └── RouteKeyRequestControllerVersionDetectorTests.cs
├── SDammann.WebApi.Versioning.Tests.csproj
├── TestSupport
│ └── Version1
│ └── CatController.cs
└── TinyIoC.cs
83 directories, 219 files
SDammann.WebApi.Versioning提供了一种简单、经过测试且可扩展的方法来为ASP.NET Web API添加版本控制支持。本教程将指导您完成设置过程,并帮助您选择合适的版本控制方案。
首先,需要在依赖容器中注册DefaultControllerIdentificationDetector和DefaultRequestControllerIdentificationDetector类。然后,根据您的需求选择一个版本控制方案并注册。例如,如果您希望通过API路由进行版本控制(这将使用像/api/v1.2/product/这样的URLs),可以在Web API配置代理中包含以下代码:
ApiVersioning.Configure(config).ConfigureRequestVersionDetector<DefaultRouteKeyVersionDetector>();此外,本教程还介绍了如何通过HTTP头实现版本控制,这是许多REST纯粹主义者偏好的方案。为此,您需要从AcceptHeaderRequestVersionDetector继承并实现GetVersionFromSingleHeader方法,然后在Web API配置代理中注册您的实现。
此外,文章还探讨了API版本控制的几个概念,包括控制器命名/版本控制、外部请求命名/版本控制以及版本本身的定义,并提供了关于自定义异常处理和控制器识别扩展的高级概念。
【实例截图】
【核心代码】
文件清单
└── SDammann.WebApi.Versioning-291b9ad21a68c6dc1fa80e6585ea0a91a057d2bd
├── LICENSE
├── nuget
│ ├── nuget.exe
│ ├── Publish.cmd
│ ├── Readme.txt
│ └── SDammann.WebApi.Versioning.nuspec
├── README.md
└── src
├── packages
│ ├── Microsoft.AspNet.Razor.3.1.2
│ │ └── lib
│ │ └── net45
│ │ ├── System.Web.Razor.dll
│ │ └── System.Web.Razor.xml
│ ├── Microsoft.AspNet.WebApi.Client.5.1.2
│ │ └── lib
│ │ ├── net45
│ │ │ ├── System.Net.Http.Formatting.dll
│ │ │ └── System.Net.Http.Formatting.xml
│ │ └── portable-wp8 netcore45 net45
│ │ ├── System.Net.Http.Formatting.dll
│ │ └── System.Net.Http.Formatting.xml
│ ├── Microsoft.AspNet.WebApi.Core.5.1.2
│ │ ├── Content
│ │ │ └── web.config.transform
│ │ └── lib
│ │ └── net45
│ │ ├── System.Web.Http.dll
│ │ └── System.Web.Http.xml
│ ├── Microsoft.AspNet.WebApi.HelpPage.5.1.2
│ │ └── Content
│ │ └── Areas
│ │ └── HelpPage
│ │ ├── ApiDescriptionExtensions.cs.pp
│ │ ├── App_Start
│ │ │ └── HelpPageConfig.cs.pp
│ │ ├── Controllers
│ │ │ └── HelpController.cs.pp
│ │ ├── HelpPageAreaRegistration.cs.pp
│ │ ├── HelpPageConfigurationExtensions.cs.pp
│ │ ├── HelpPage.css.pp
│ │ ├── ModelDescriptions
│ │ │ ├── CollectionModelDescription.cs.pp
│ │ │ ├── ComplexTypeModelDescription.cs.pp
│ │ │ ├── DictionaryModelDescription.cs.pp
│ │ │ ├── EnumTypeModelDescription.cs.pp
│ │ │ ├── EnumValueDescription.cs.pp
│ │ │ ├── IModelDocumentationProvider.cs.pp
│ │ │ ├── KeyValuePairModelDescription.cs.pp
│ │ │ ├── ModelDescription.cs.pp
│ │ │ ├── ModelDescriptionGenerator.cs.pp
│ │ │ ├── ModelNameAttribute.cs.pp
│ │ │ ├── ModelNameHelper.cs.pp
│ │ │ ├── ParameterAnnotation.cs.pp
│ │ │ ├── ParameterDescription.cs.pp
│ │ │ └── SimpleTypeModelDescription.cs.pp
│ │ ├── Models
│ │ │ └── HelpPageApiModel.cs.pp
│ │ ├── SampleGeneration
│ │ │ ├── HelpPageSampleGenerator.cs.pp
│ │ │ ├── HelpPageSampleKey.cs.pp
│ │ │ ├── ImageSample.cs.pp
│ │ │ ├── InvalidSample.cs.pp
│ │ │ ├── ObjectGenerator.cs.pp
│ │ │ ├── SampleDirection.cs.pp
│ │ │ └── TextSample.cs.pp
│ │ ├── Views
│ │ │ ├── Help
│ │ │ │ ├── Api.cshtml.pp
│ │ │ │ ├── DisplayTemplates
│ │ │ │ │ ├── ApiGroup.cshtml.pp
│ │ │ │ │ ├── CollectionModelDescription.cshtml.pp
│ │ │ │ │ ├── ComplexTypeModelDescription.cshtml.pp
│ │ │ │ │ ├── DictionaryModelDescription.cshtml.pp
│ │ │ │ │ ├── EnumTypeModelDescription.cshtml.pp
│ │ │ │ │ ├── HelpPageApiModel.cshtml.pp
│ │ │ │ │ ├── ImageSample.cshtml.pp
│ │ │ │ │ ├── InvalidSample.cshtml.pp
│ │ │ │ │ ├── KeyValuePairModelDescription.cshtml.pp
│ │ │ │ │ ├── ModelDescriptionLink.cshtml.pp
│ │ │ │ │ ├── Parameters.cshtml.pp
│ │ │ │ │ ├── Samples.cshtml.pp
│ │ │ │ │ ├── SimpleTypeModelDescription.cshtml.pp
│ │ │ │ │ └── TextSample.cshtml.pp
│ │ │ │ ├── Index.cshtml.pp
│ │ │ │ └── ResourceModel.cshtml.pp
│ │ │ ├── Shared
│ │ │ │ └── _Layout.cshtml.pp
│ │ │ ├── _ViewStart.cshtml.pp
│ │ │ └── Web.config
│ │ └── XmlDocumentationProvider.cs.pp
│ ├── Microsoft.AspNet.WebApi.WebHost.5.1.2
│ │ └── lib
│ │ └── net45
│ │ ├── System.Web.Http.WebHost.dll
│ │ └── System.Web.Http.WebHost.xml
│ ├── Microsoft.Web.Infrastructure.1.0.0.0
│ │ └── lib
│ │ └── net40
│ │ └── Microsoft.Web.Infrastructure.dll
│ └── WebApi.DocumentationController.3.2.1.0
│ ├── content
│ │ ├── Content
│ │ │ └── documentation
│ │ │ └── documentation.css
│ │ ├── Scripts
│ │ │ └── documentation.js
│ │ └── Views
│ │ └── Help
│ │ ├── Details.cshtml
│ │ ├── _HelpLayout.cshtml
│ │ ├── Index.cshtml
│ │ └── ModelDiagram.cshtml
│ ├── lib
│ │ └── net45
│ │ ├── WebApi.DocumentationController.dll
│ │ ├── WebApi.DocumentationController.pdb
│ │ └── WebApi.DocumentationController.XML
│ └── tools
│ ├── init.ps1
│ ├── install.ps1
│ └── uninstall.ps1
├── SDammann.WebApi.Versioning
│ ├── ApiVersion.cs
│ ├── app.config
│ ├── Configuration
│ │ ├── ApiVersioningConfiguration.cs
│ │ └── ApiVersioning.cs
│ ├── ControllerIdentification.cs
│ ├── Discovery
│ │ ├── ApiVersionAttribute.cs
│ │ ├── AttributeControllerVersionDetector.cs
│ │ ├── DefaultAttributeControllerVersionDetector.cs
│ │ ├── DefaultControllerIdentificationDetector.cs
│ │ ├── DefaultControllerNameDetector.cs
│ │ ├── DefaultControllerVersionDetector.cs
│ │ ├── IControllerIdentificationDetector.cs
│ │ ├── IControllerNameDetector.cs
│ │ ├── IControllerVersionDetector.cs
│ │ ├── NamespaceControllerVersionDetector.cs
│ │ └── TypeNameControllerNameDetector.cs
│ ├── Documentation
│ │ ├── MultiVersionHttpControllerDescriptor.cs
│ │ └── VersionedApiExplorer.cs
│ ├── ErrorHandling
│ │ ├── AmbigiousApiRequestException.cs
│ │ ├── ApiControllerNotFoundException.cs
│ │ ├── ApiVersioningExceptionHandler.cs
│ │ ├── ApiVersionNotDeterminedException.cs
│ │ ├── BaseApiException.cs
│ │ ├── DefaultVersioningExceptionHandler.cs
│ │ └── IVersioningExceptionHandler.cs
│ ├── ExceptionResources.Designer.cs
│ ├── ExceptionResources.resx
│ ├── Internal
│ │ ├── HttpControllerTypeCache.cs
│ │ └── ServicesExtensions.cs
│ ├── packages.config
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Request
│ │ ├── AcceptHeaderRequestVersionDetector.cs
│ │ ├── ApiVersionFormatException.cs
│ │ ├── DefaultRequestControllerIdentificationDetector.cs
│ │ ├── DefaultRequestControllerNameDetector.cs
│ │ ├── DefaultRouteKeyVersionDetector.cs
│ │ ├── IRequestControllerIdentificationDetector.cs
│ │ ├── IRequestControllerNameDetector.cs
│ │ ├── IRequestVersionDetector.cs
│ │ ├── RouteKeyRequestControllerNameDetector.cs
│ │ └── RouteKeyVersionDetector.cs
│ ├── SDammann.WebApi.Versioning.csproj
│ ├── SemVerApiVersion.cs
│ ├── Signkey.snk
│ ├── UndefinedApiVersion.cs
│ ├── VersionedApiControllerSelector.cs
│ └── VersionedApiExplorer.cs
├── SDammann.WebApi.Versioning.sln
├── SDammann.WebApi.Versioning.TestApi
│ ├── Api
│ │ └── ValuesController.cs
│ ├── App_Start
│ │ ├── BundleConfig.cs
│ │ ├── FilterConfig.cs
│ │ ├── RouteConfig.cs
│ │ └── WebApiConfig.cs
│ ├── Areas
│ │ └── HelpPage
│ │ ├── ApiDescriptionExtensions.cs
│ │ ├── App_Start
│ │ │ └── HelpPageConfig.cs
│ │ ├── Controllers
│ │ │ └── HelpController.cs
│ │ ├── HelpPageAreaRegistration.cs
│ │ ├── HelpPageConfigurationExtensions.cs
│ │ ├── HelpPage.css
│ │ ├── ModelDescriptions
│ │ │ ├── CollectionModelDescription.cs
│ │ │ ├── ComplexTypeModelDescription.cs
│ │ │ ├── DictionaryModelDescription.cs
│ │ │ ├── EnumTypeModelDescription.cs
│ │ │ ├── EnumValueDescription.cs
│ │ │ ├── IModelDocumentationProvider.cs
│ │ │ ├── KeyValuePairModelDescription.cs
│ │ │ ├── ModelDescription.cs
│ │ │ ├── ModelDescriptionGenerator.cs
│ │ │ ├── ModelNameAttribute.cs
│ │ │ ├── ModelNameHelper.cs
│ │ │ ├── ParameterAnnotation.cs
│ │ │ ├── ParameterDescription.cs
│ │ │ └── SimpleTypeModelDescription.cs
│ │ ├── Models
│ │ │ └── HelpPageApiModel.cs
│ │ ├── SampleGeneration
│ │ │ ├── HelpPageSampleGenerator.cs
│ │ │ ├── HelpPageSampleKey.cs
│ │ │ ├── ImageSample.cs
│ │ │ ├── InvalidSample.cs
│ │ │ ├── ObjectGenerator.cs
│ │ │ ├── SampleDirection.cs
│ │ │ └── TextSample.cs
│ │ ├── Views
│ │ │ ├── Help
│ │ │ │ ├── Api.cshtml
│ │ │ │ ├── DisplayTemplates
│ │ │ │ │ ├── ApiGroup.cshtml
│ │ │ │ │ ├── CollectionModelDescription.cshtml
│ │ │ │ │ ├── ComplexTypeModelDescription.cshtml
│ │ │ │ │ ├── DictionaryModelDescription.cshtml
│ │ │ │ │ ├── EnumTypeModelDescription.cshtml
│ │ │ │ │ ├── HelpPageApiModel.cshtml
│ │ │ │ │ ├── ImageSample.cshtml
│ │ │ │ │ ├── InvalidSample.cshtml
│ │ │ │ │ ├── KeyValuePairModelDescription.cshtml
│ │ │ │ │ ├── ModelDescriptionLink.cshtml
│ │ │ │ │ ├── Parameters.cshtml
│ │ │ │ │ ├── Samples.cshtml
│ │ │ │ │ ├── SimpleTypeModelDescription.cshtml
│ │ │ │ │ └── TextSample.cshtml
│ │ │ │ ├── Index.cshtml
│ │ │ │ └── ResourceModel.cshtml
│ │ │ ├── Shared
│ │ │ │ └── _Layout.cshtml
│ │ │ ├── _ViewStart.cshtml
│ │ │ └── Web.config
│ │ └── XmlDocumentationProvider.cs
│ ├── Content
│ │ ├── bootstrap.css
│ │ ├── bootstrap.css.map
│ │ ├── bootstrap.min.css
│ │ └── Site.css
│ ├── Controllers
│ │ └── HomeController.cs
│ ├── favicon.ico
│ ├── Global.asax
│ ├── Global.asax.cs
│ ├── packages.config
│ ├── Project_Readme.html
│ ├── Properties
│ │ └── AssemblyInfo.cs
│ ├── Scripts
│ │ └── _references.js
│ ├── SDammann.WebApi.Versioning.TestApi.csproj
│ ├── Startup.cs
│ ├── TinyIoC.cs
│ ├── Views
│ │ ├── Home
│ │ │ └── Index.cshtml
│ │ ├── Shared
│ │ │ ├── Error.cshtml
│ │ │ └── _Layout.cshtml
│ │ ├── _ViewStart.cshtml
│ │ └── Web.config
│ ├── Web.config
│ ├── Web.Debug.config
│ └── Web.Release.config
└── SDammann.WebApi.Versioning.Tests
├── app.config
├── Discovery
│ ├── DefaultAttributeControllerVersionDetector.cs
│ ├── NamespaceControllerVersionDetectorTests.cs
│ └── TypeNameControllerNameDetectorTests.cs
├── Integration
│ ├── Controllers
│ │ ├── Version1
│ │ │ └── HelloController.cs
│ │ └── Version2_5
│ │ └── HelloController.cs
│ ├── DefaultSettingsIntegrationTest.cs
│ └── IntegrationTestManager.cs
├── packages.config
├── Properties
│ └── AssemblyInfo.cs
├── Request
│ ├── RouteKeyRequestControllerNameDetectorTests.cs
│ └── RouteKeyRequestControllerVersionDetectorTests.cs
├── SDammann.WebApi.Versioning.Tests.csproj
├── TestSupport
│ └── Version1
│ └── CatController.cs
└── TinyIoC.cs
83 directories, 219 files
好例子网口号:伸出你的我的手 — 分享!
小贴士
感谢您为本站写下的评论,您的评论对其它用户来说具有重要的参考价值,所以请认真填写。
- 类似“顶”、“沙发”之类没有营养的文字,对勤劳贡献的楼主来说是令人沮丧的反馈信息。
- 相信您也不想看到一排文字/表情墙,所以请不要反馈意义不大的重复字符,也请尽量不要纯表情的回复。
- 提问之前请再仔细看一遍楼主的说明,或许是您遗漏了。
- 请勿到处挖坑绊人、招贴广告。既占空间让人厌烦,又没人会搭理,于人于己都无利。
关于好例子网
本站旨在为广大IT学习爱好者提供一个非营利性互相学习交流分享平台。本站所有资源都可以被免费获取学习研究。本站资源来自网友分享,对搜索内容的合法性不具有预见性、识别性、控制性,仅供学习研究,请务必在下载后24小时内给予删除,不得用于其他任何用途,否则后果自负。基于互联网的特殊性,平台无法对用户传输的作品、信息、内容的权属或合法性、安全性、合规性、真实性、科学性、完整权、有效性等进行实质审查;无论平台是否已进行审查,用户均应自行承担因其传输的作品、信息、内容而可能或已经产生的侵权或权属纠纷等法律责任。本站所有资源不代表本站的观点或立场,基于网友分享,根据中国法律《信息网络传播权保护条例》第二十二与二十三条之规定,若资源存在侵权或相关问题请联系本站客服人员,点此联系我们。关于更多版权及免责申明参见 版权及免责申明
网友评论
我要评论