diff --git a/Mvc.NoFun.sln b/Mvc.NoFun.sln index d67abd6f60..0a8840d257 100644 --- a/Mvc.NoFun.sln +++ b/Mvc.NoFun.sln @@ -28,10 +28,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Co EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.Test", "test\Microsoft.AspNetCore.Mvc.Test\Microsoft.AspNetCore.Mvc.Test.csproj", "{5F945B82-FE5F-425C-956C-8BC2F2020254}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.WebApiCompatShim", "src\Microsoft.AspNetCore.Mvc.WebApiCompatShim\Microsoft.AspNetCore.Mvc.WebApiCompatShim.csproj", "{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.WebApiCompatShimTest", "test\Microsoft.AspNetCore.Mvc.WebApiCompatShimTest\Microsoft.AspNetCore.Mvc.WebApiCompatShimTest.csproj", "{5DE8E4D9-AACD-4B5F-819F-F091383FB996}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.TagHelpers", "src\Microsoft.AspNetCore.Mvc.TagHelpers\Microsoft.AspNetCore.Mvc.TagHelpers.csproj", "{B2347320-308E-4D2B-AEC8-005DFA68B0C9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.TagHelpers.Test", "test\Microsoft.AspNetCore.Mvc.TagHelpers.Test\Microsoft.AspNetCore.Mvc.TagHelpers.Test.csproj", "{860119ED-3DB1-424D-8D0A-30132A8A7D96}" @@ -193,26 +189,6 @@ Global {5F945B82-FE5F-425C-956C-8BC2F2020254}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {5F945B82-FE5F-425C-956C-8BC2F2020254}.Release|Mixed Platforms.Build.0 = Release|Any CPU {5F945B82-FE5F-425C-956C-8BC2F2020254}.Release|x86.ActiveCfg = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|x86.ActiveCfg = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Any CPU.Build.0 = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|x86.ActiveCfg = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|x86.ActiveCfg = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Any CPU.Build.0 = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|x86.ActiveCfg = Release|Any CPU {B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Any CPU.Build.0 = Debug|Any CPU {B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -628,8 +604,6 @@ Global {3F6E355E-4869-41D9-943B-D54771221A7F} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {A8AA326E-8EE8-4F11-B750-23028E0949D7} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {5F945B82-FE5F-425C-956C-8BC2F2020254} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E} - {5DE8E4D9-AACD-4B5F-819F-F091383FB996} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {B2347320-308E-4D2B-AEC8-005DFA68B0C9} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E} {860119ED-3DB1-424D-8D0A-30132A8A7D96} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {F504357E-C2E1-4818-BA5C-9A2EAC25FEE5} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} diff --git a/Mvc.sln b/Mvc.sln index dcd83f09ca..00eabf0c6a 100644 --- a/Mvc.sln +++ b/Mvc.sln @@ -53,12 +53,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "FilesWebSite", "test\WebSit EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "ApplicationModelWebSite", "test\WebSites\ApplicationModelWebSite\ApplicationModelWebSite.csproj", "{CAE52CB7-0FAC-4B5B-8251-B0FF837DB657}" EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.WebApiCompatShim", "src\Microsoft.AspNetCore.Mvc.WebApiCompatShim\Microsoft.AspNetCore.Mvc.WebApiCompatShim.csproj", "{23D30B8C-04B1-4577-A604-ED27EA1E4A0E}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "WebApiCompatShimWebSite", "test\WebSites\WebApiCompatShimWebSite\WebApiCompatShimWebSite.csproj", "{B2B7BC91-688E-4C1E-A71F-CE948D958DDF}" -EndProject -Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.WebApiCompatShimTest", "test\Microsoft.AspNetCore.Mvc.WebApiCompatShimTest\Microsoft.AspNetCore.Mvc.WebApiCompatShimTest.csproj", "{5DE8E4D9-AACD-4B5F-819F-F091383FB996}" -EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.TagHelpers", "src\Microsoft.AspNetCore.Mvc.TagHelpers\Microsoft.AspNetCore.Mvc.TagHelpers.csproj", "{B2347320-308E-4D2B-AEC8-005DFA68B0C9}" EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Mvc.TagHelpers.Test", "test\Microsoft.AspNetCore.Mvc.TagHelpers.Test\Microsoft.AspNetCore.Mvc.TagHelpers.Test.csproj", "{860119ED-3DB1-424D-8D0A-30132A8A7D96}" @@ -354,36 +348,6 @@ Global {CAE52CB7-0FAC-4B5B-8251-B0FF837DB657}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {CAE52CB7-0FAC-4B5B-8251-B0FF837DB657}.Release|Mixed Platforms.Build.0 = Release|Any CPU {CAE52CB7-0FAC-4B5B-8251-B0FF837DB657}.Release|x86.ActiveCfg = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Any CPU.Build.0 = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Debug|x86.ActiveCfg = Debug|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Any CPU.ActiveCfg = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Any CPU.Build.0 = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E}.Release|x86.ActiveCfg = Release|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|Any CPU.Build.0 = Debug|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Debug|x86.ActiveCfg = Debug|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|Any CPU.ActiveCfg = Release|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|Any CPU.Build.0 = Release|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF}.Release|x86.ActiveCfg = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Any CPU.Build.0 = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Debug|x86.ActiveCfg = Debug|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Any CPU.ActiveCfg = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Any CPU.Build.0 = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|Mixed Platforms.Build.0 = Release|Any CPU - {5DE8E4D9-AACD-4B5F-819F-F091383FB996}.Release|x86.ActiveCfg = Release|Any CPU {B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Any CPU.Build.0 = Debug|Any CPU {B2347320-308E-4D2B-AEC8-005DFA68B0C9}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU @@ -1002,9 +966,6 @@ Global {6DB9B8D0-80F7-4E70-BBB0-0B4C04D79A47} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C} {0EF9860B-10D7-452F-B0F4-A405B88BEBB3} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C} {CAE52CB7-0FAC-4B5B-8251-B0FF837DB657} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C} - {23D30B8C-04B1-4577-A604-ED27EA1E4A0E} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E} - {B2B7BC91-688E-4C1E-A71F-CE948D958DDF} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C} - {5DE8E4D9-AACD-4B5F-819F-F091383FB996} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {B2347320-308E-4D2B-AEC8-005DFA68B0C9} = {32285FA4-6B46-4D6B-A840-2B13E4C8B58E} {860119ED-3DB1-424D-8D0A-30132A8A7D96} = {3BA657BF-28B1-42DA-B5B0-1C4601FCF7B1} {920F8A0E-6F7D-4BBE-84FF-840B89099BE6} = {16703B76-C9F7-4C75-AE6C-53D92E308E3C} diff --git a/src/Microsoft.AspNetCore.Mvc.Core/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Mvc.Core/Properties/AssemblyInfo.cs index af2d56cd8b..14bede0243 100644 --- a/src/Microsoft.AspNetCore.Mvc.Core/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNetCore.Mvc.Core/Properties/AssemblyInfo.cs @@ -18,7 +18,6 @@ using Microsoft.AspNetCore.Mvc.Formatters; [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.TagHelpers, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Testing, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.ViewFeatures, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.WebApiCompatShim, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Abstractions.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.ApiExplorer.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] @@ -36,7 +35,6 @@ using Microsoft.AspNetCore.Mvc.Formatters; [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.ViewFeatures.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Views.TestCommon, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] -[assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.WebApiCompatShimTest, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] [assembly: InternalsVisibleTo("Microsoft.AspNetCore.Mvc.Performance, PublicKey=0024000004800000940000000602000000240000525341310004000001000100f33a29044fa9d740c9b3213a93e57c84b472c84e0b8a0e1ae48e67a9f8f6de9d5f7f3d52ac23e48ac51801f1dc950abe901da34d2a9e3baadb141a17c77ef3c565dd5ee5054b91cf63bb3c6ab83f72ab3aafe93d0fc3c2348b764fafb0b1c0733de51459aeab46580384bf9d74c4e28164b7cde247f891ba07891c9d872ad2bb")] diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ApiController.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ApiController.cs deleted file mode 100644 index ef5c4d6a38..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ApiController.cs +++ /dev/null @@ -1,580 +0,0 @@ -// 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.Net; -using System.Net.Http; -using System.Security.Principal; -using System.Text; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ModelBinding; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; -using Microsoft.AspNetCore.Mvc.Routing; -using Microsoft.AspNetCore.Mvc.WebApiCompatShim; -using Microsoft.Extensions.DependencyInjection; -using Newtonsoft.Json; - -namespace System.Web.Http -{ - [UseWebApiRoutes] - [UseWebApiActionConventions] - [UseWebApiParameterConventions] - [UseWebApiOverloading] - [Controller] - public abstract class ApiController : IDisposable - { - private ControllerContext _controllerContext; - private HttpRequestMessage _request; - private IModelMetadataProvider _metadataProvider; - private IObjectModelValidator _objectValidator; - private IUrlHelper _urlHelper; - - /// - /// Gets the . - /// - public ActionContext ActionContext => ControllerContext; - - /// - /// Gets or sets the . - /// - /// The setter is intended for unit testing purposes only. - [ControllerContext] - public ControllerContext ControllerContext - { - get - { - if (_controllerContext == null) - { - _controllerContext = new ControllerContext(); - } - - return _controllerContext; - } - set - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - _controllerContext = value; - } - } - - /// - /// Gets the http context. - /// - public HttpContext Context - { - get - { - return ControllerContext.HttpContext; - } - } - - /// - /// Gets the . - /// - /// The setter is intended for unit testing purposes only. - public IModelMetadataProvider MetadataProvider - { - get - { - if (_metadataProvider == null) - { - _metadataProvider = Context?.RequestServices.GetRequiredService(); - } - - return _metadataProvider; - } - set - { - _metadataProvider = value; - } - } - - /// - /// Gets or sets the . - /// - public IObjectModelValidator ObjectValidator - { - get - { - if (_objectValidator == null) - { - _objectValidator = Context?.RequestServices.GetRequiredService(); - } - - return _objectValidator; - } - set - { - _objectValidator = value; - } - } - - /// - /// Gets model state after the model binding process. This ModelState will be empty before model binding - /// happens. - /// - public ModelStateDictionary ModelState - { - get - { - return ControllerContext.ModelState; - } - } - - /// - /// Gets or sets the HTTP request message. - /// - /// The setter is intended for unit testing purposes only. - public HttpRequestMessage Request - { - get - { - if (_request == null && ActionContext != null) - { - _request = ControllerContext.HttpContext.GetHttpRequestMessage(); - } - - return _request; - } - set - { - _request = value; - } - } - - /// - /// Gets a factory used to generate URLs to other APIs. - /// - /// The setter is intended for unit testing purposes only. - public IUrlHelper Url - { - get - { - if (_urlHelper == null) - { - var factory = Context?.RequestServices.GetRequiredService(); - _urlHelper = factory?.GetUrlHelper(ActionContext); - } - - return _urlHelper; - } - set - { - _urlHelper = value; - } - } - - /// - /// Gets or sets the current principal associated with this request. - /// - public IPrincipal User - { - get - { - return Context?.User; - } - } - - /// - /// Creates a (400 Bad Request). - /// - /// A . - [NonAction] - public virtual BadRequestResult BadRequest() - { - return new BadRequestResult(); - } - - /// - /// Creates a (400 Bad Request) with the specified error message. - /// - /// The user-visible error message. - /// A with the specified error message. - [NonAction] - public virtual BadRequestErrorMessageResult BadRequest(string message) - { - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - - return new BadRequestErrorMessageResult(message); - } - - /// - /// Creates an (400 Bad Request) with the specified model state. - /// - /// The model state to include in the error. - /// An with the specified model state. - [NonAction] - public virtual InvalidModelStateResult BadRequest(ModelStateDictionary modelState) - { - if (modelState == null) - { - throw new ArgumentNullException(nameof(modelState)); - } - - return new InvalidModelStateResult(modelState, includeErrorDetail: false); - } - - /// Creates a (409 Conflict). - /// A . - [NonAction] - public virtual ConflictResult Conflict() - { - return new ConflictResult(); - } - - /// - /// Creates a with the specified values. - /// - /// The type of content in the entity body. - /// The HTTP status code for the response message. - /// The content value to negotiate and format in the entity body. - /// A with the specified values. - [NonAction] - public virtual NegotiatedContentResult Content(HttpStatusCode statusCode, T value) - { - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - return new NegotiatedContentResult(statusCode, value); - } - - /// - /// Creates a (201 Created) with the specified values. - /// - /// - /// The location at which the content has been created. Must be a relative or absolute URL. - /// - /// The content value to format in the entity body. - /// A with the specified values. - [NonAction] - public virtual CreatedResult Created(string location, object content) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - return new CreatedResult(location, content); - } - - /// - /// Creates a (201 Created) with the specified values. - /// - /// The location at which the content has been created. - /// The content value to format in the entity body. - /// A with the specified values. - [NonAction] - public virtual CreatedResult Created(Uri uri, object content) - { - if (uri == null) - { - throw new ArgumentNullException(nameof(uri)); - } - - string location; - if (uri.IsAbsoluteUri) - { - location = uri.AbsoluteUri; - } - else - { - location = uri.GetComponents(UriComponents.SerializationInfoString, UriFormat.UriEscaped); - } - return Created(location, content); - } - - /// - /// Creates a (201 Created) with the specified values. - /// - /// The name of the route to use for generating the URL. - /// The route data to use for generating the URL. - /// The content value to format in the entity body. - /// A with the specified values. - [NonAction] - public virtual CreatedAtRouteResult CreatedAtRoute( - string routeName, - object routeValues, - object content) - { - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - - return new CreatedAtRouteResult(routeName, routeValues, content); - } - - /// Creates an (500 Internal Server Error). - /// - /// A . - [NonAction] - public virtual InternalServerErrorResult InternalServerError() - { - return new InternalServerErrorResult(); - } - - /// - /// Creates an (500 Internal Server Error) with the specified exception. - /// - /// The exception to include in the error. - /// An with the specified exception. - [NonAction] - public virtual ExceptionResult InternalServerError(Exception exception) - { - if (exception == null) - { - throw new ArgumentNullException(nameof(exception)); - } - - return new ExceptionResult(exception, includeErrorDetail: false); - } - - /// - /// Creates an (200 OK) with the specified value. - /// - /// The type of content in the entity body. - /// The content value to serialize in the entity body. - /// A with the specified value. - [NonAction] - public virtual JsonResult Json(T content) - { - if (content == null) - { - throw new ArgumentNullException(nameof(content)); - } - - return new JsonResult(content); - } - - /// - /// Creates an (200 OK) with the specified values. - /// - /// The type of content in the entity body. - /// The content value to serialize in the entity body. - /// The serializer settings. - /// A with the specified values. - [NonAction] - public virtual JsonResult Json(T content, JsonSerializerSettings serializerSettings) - { - if (content == null) - { - throw new ArgumentNullException(nameof(content)); - } - - if (serializerSettings == null) - { - throw new ArgumentNullException(nameof(serializerSettings)); - } - - return new JsonResult(content, serializerSettings); - } - - /// - /// Creates an (200 OK) with the specified values. - /// - /// The type of content in the entity body. - /// The content value to serialize in the entity body. - /// The serializer settings. - /// The content encoding. - /// A with the specified values. - [NonAction] - public virtual JsonResult Json( - T content, - JsonSerializerSettings serializerSettings, - Encoding encoding) - { - if (content == null) - { - throw new ArgumentNullException(nameof(content)); - } - - if (serializerSettings == null) - { - throw new ArgumentNullException(nameof(serializerSettings)); - } - - if (encoding == null) - { - throw new ArgumentNullException(nameof(encoding)); - } - - var result = new JsonResult(content, serializerSettings); - result.ContentType = $"application/json; charset={encoding.WebName}"; - - return result; - } - - /// - /// Creates an (404 Not Found). - /// - /// A . - [NonAction] - public virtual NotFoundResult NotFound() - { - return new NotFoundResult(); - } - - /// - /// Creates an (200 OK). - /// - /// An . - [NonAction] - public virtual OkResult Ok() - { - return new OkResult(); - } - - /// - /// Creates an (200 OK) with the specified values. - /// - /// The type of content in the entity body. - /// The content value to negotiate and format in the entity body. - /// An with the specified values. - [NonAction] - public virtual OkObjectResult Ok(T content) - { - return new OkObjectResult(content); - } - - /// - /// Creates a (302 Found) with the specified value. - /// - /// The location to which to redirect. - /// A with the specified value. - [NonAction] - public virtual RedirectResult Redirect(string location) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - // This is how redirect was implemented in legacy webapi - string URIs are assumed to be absolute. - return Redirect(new Uri(location)); - } - - /// - /// Creates a (302 Found) with the specified value. - /// - /// The location to which to redirect. - /// A with the specified value. - [NonAction] - public virtual RedirectResult Redirect(Uri location) - { - if (location == null) - { - throw new ArgumentNullException(nameof(location)); - } - - string uri; - if (location.IsAbsoluteUri) - { - uri = location.AbsoluteUri; - } - else - { - uri = location.GetComponents(UriComponents.SerializationInfoString, UriFormat.UriEscaped); - } - - return new RedirectResult(uri); - } - - /// - /// Creates a (302 Found) with the specified values. - /// - /// The name of the route to use for generating the URL. - /// The route data to use for generating the URL. - /// A with the specified values. - [NonAction] - public virtual RedirectToRouteResult RedirectToRoute(string routeName, object routeValues) - { - if (routeName == null) - { - throw new ArgumentNullException(nameof(routeName)); - } - - if (routeValues == null) - { - throw new ArgumentNullException(nameof(routeValues)); - } - - return new RedirectToRouteResult(routeName, routeValues) - { - UrlHelper = Url, - }; - } - - /// - /// Creates a with the specified response. - /// - /// The HTTP response message. - /// A for the specified response. - [NonAction] - public virtual ResponseMessageResult ResponseMessage(HttpResponseMessage response) - { - if (response == null) - { - throw new ArgumentNullException(nameof(response)); - } - - return new ResponseMessageResult(response); - } - - /// - /// Creates a with the specified status code. - /// - /// The HTTP status code for the response message - /// A with the specified status code. - [NonAction] - public virtual StatusCodeResult StatusCode(HttpStatusCode status) - { - return new StatusCodeResult((int)status); - } - - /// - public void Dispose() => Dispose(disposing: true); - - /// - /// Validates the given entity and adds the validation errors to the - /// under an empty prefix. - /// - /// The type of the entity to be validated. - /// The entity being validated. - public void Validate(TEntity entity) - { - Validate(entity, keyPrefix: string.Empty); - } - - /// - /// Validates the given entity and adds the validation errors to the . - /// - /// The type of the entity to be validated. - /// The entity being validated. - /// - /// The key prefix under which the model state errors would be added in the - /// . - /// - public void Validate(TEntity entity, string keyPrefix) - { - ObjectValidator.Validate( - ControllerContext, - validationState: null, - prefix: keyPrefix, - model: entity); - } - - protected virtual void Dispose(bool disposing) - { - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/BadRequestErrorMessageResult.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/BadRequestErrorMessageResult.cs deleted file mode 100644 index f9f313f899..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/BadRequestErrorMessageResult.cs +++ /dev/null @@ -1,41 +0,0 @@ -// 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.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace System.Web.Http -{ - /// - /// An action result that returns a response and performs - /// content negotiation on an with a . - /// - public class BadRequestErrorMessageResult : ObjectResult - { - /// Initializes a new instance of the class. - /// The user-visible error message. - public BadRequestErrorMessageResult(string message) - : base(new HttpError(message)) - { - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - - Message = message; - } - - /// - /// Gets the error message. - /// - public string Message { get; private set; } - - /// - public override Task ExecuteResultAsync(ActionContext context) - { - context.HttpContext.Response.StatusCode = StatusCodes.Status400BadRequest; - return base.ExecuteResultAsync(context); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ConflictResult.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ConflictResult.cs deleted file mode 100644 index ee83c08611..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ConflictResult.cs +++ /dev/null @@ -1,22 +0,0 @@ -// 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 Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace System.Web.Http -{ - /// - /// An action result that returns an empty response. - /// - public class ConflictResult : StatusCodeResult - { - /// - /// Initializes a new instance of the class. - /// - public ConflictResult() - : base(StatusCodes.Status409Conflict) - { - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiActionConventions.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiActionConventions.cs deleted file mode 100644 index e2ac33be1a..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiActionConventions.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// Indicates actions without attribute routes in a controller use ASP.NET Web API routing conventions. - /// - public interface IUseWebApiActionConventions - { - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiOverloading.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiOverloading.cs deleted file mode 100644 index cb92ea4661..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiOverloading.cs +++ /dev/null @@ -1,13 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// Indicates actions in a controller should be selected only if all non-optional parameters are satisfied. Applies - /// the to all actions in the controller. - /// - public interface IUseWebApiOverloading - { - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiParameterConventions.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiParameterConventions.cs deleted file mode 100644 index 1f74ef2fc6..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiParameterConventions.cs +++ /dev/null @@ -1,13 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// Indicates the model binding system should use ASP.NET Web API conventions for parameters of a controller's - /// actions. For example, bind simple types from the URI. - /// - public interface IUseWebApiParameterConventions - { - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiRoutes.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiRoutes.cs deleted file mode 100644 index f0efadbd90..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/IUseWebApiRoutes.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// Indicates the controller is in the "api" area. - /// - public interface IUseWebApiRoutes - { - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiActionConventionsAttribute.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiActionConventionsAttribute.cs deleted file mode 100644 index 15a0725f50..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiActionConventionsAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// Indicates actions without attribute routes in a controller use ASP.NET Web API routing conventions. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] - public class UseWebApiActionConventionsAttribute : Attribute, IUseWebApiActionConventions - { - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiOverloadingAttribute.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiOverloadingAttribute.cs deleted file mode 100644 index f253f0f0bf..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiOverloadingAttribute.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// Indicates actions in a controller should be selected only if all non-optional parameters are satisfied. Applies - /// the to all actions in the controller. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] - public class UseWebApiOverloadingAttribute : Attribute, IUseWebApiOverloading - { - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiParameterConventionsAttribute.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiParameterConventionsAttribute.cs deleted file mode 100644 index 3626945271..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiParameterConventionsAttribute.cs +++ /dev/null @@ -1,16 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// Indicates the model binding system should use ASP.NET Web API conventions for parameters of a controller's - /// actions. For example, bind simple types from the URI. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] - public class UseWebApiParameterConventionsAttribute : Attribute, IUseWebApiParameterConventions - { - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiRoutesAttribute.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiRoutesAttribute.cs deleted file mode 100644 index 17d14aba37..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/UseWebApiRoutesAttribute.cs +++ /dev/null @@ -1,15 +0,0 @@ -// 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; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// Indicates the controller is in the "api" area. - /// - [AttributeUsage(AttributeTargets.Class, AllowMultiple = false, Inherited = true)] - public class UseWebApiRoutesAttribute : Attribute, IUseWebApiRoutes - { - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiActionConventionsApplicationModelConvention.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiActionConventionsApplicationModelConvention.cs deleted file mode 100644 index 923bd75192..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiActionConventionsApplicationModelConvention.cs +++ /dev/null @@ -1,117 +0,0 @@ -// 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; -using System.Collections.Generic; -using System.Linq; -using Microsoft.AspNetCore.Mvc.ActionConstraints; -using Microsoft.AspNetCore.Mvc.ApplicationModels; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public class WebApiActionConventionsApplicationModelConvention : IControllerModelConvention - { - private static readonly string[] SupportedHttpMethodConventions = new string[] - { - "GET", - "PUT", - "POST", - "DELETE", - "PATCH", - "HEAD", - "OPTIONS", - }; - - public void Apply(ControllerModel controller) - { - if (controller == null) - { - throw new ArgumentNullException(nameof(controller)); - } - - if (IsConventionApplicable(controller)) - { - var newActions = new List(); - - foreach (var action in controller.Actions) - { - SetHttpMethodFromConvention(action); - - // Action Name doesn't really come into play with attribute routed actions. However for a - // non-attribute-routed action we need to create a 'named' version and an 'unnamed' version. - if (!IsActionAttributeRouted(action)) - { - var namedAction = action; - - var unnamedAction = new ActionModel(namedAction); - unnamedAction.RouteValues.Add("action", null); - newActions.Add(unnamedAction); - } - } - - foreach (var action in newActions) - { - controller.Actions.Add(action); - } - } - } - - private bool IsConventionApplicable(ControllerModel controller) - { - return controller.Attributes.OfType().Any(); - } - - private bool IsActionAttributeRouted(ActionModel action) - { - foreach (var controllerSelectorModel in action.Controller.Selectors) - { - if (controllerSelectorModel.AttributeRouteModel?.Template != null) - { - return true; - } - } - - foreach (var actionSelectorModel in action.Selectors) - { - if (actionSelectorModel.AttributeRouteModel?.Template != null) - { - return true; - } - } - - return false; - } - - private void SetHttpMethodFromConvention(ActionModel action) - { - foreach (var selector in action.Selectors) - { - if (selector.ActionConstraints.OfType().Count() > 0) - { - // If the HttpMethods are set from attributes, don't override it with the convention - return; - } - } - - // The Method name is used to infer verb constraints. Changing the action name has no impact. - foreach (var verb in SupportedHttpMethodConventions) - { - if (action.ActionMethod.Name.StartsWith(verb, StringComparison.OrdinalIgnoreCase)) - { - foreach (var selector in action.Selectors) - { - selector.ActionConstraints.Add(new HttpMethodActionConstraint(new[] { verb })); - } - - return; - } - } - - // If no convention matches, then assume POST - foreach (var actionSelectorModel in action.Selectors) - { - actionSelectorModel.ActionConstraints.Add(new HttpMethodActionConstraint(new[] { "POST" })); - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiOverloadingApplicationModelConvention.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiOverloadingApplicationModelConvention.cs deleted file mode 100644 index 5a90c715ca..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiOverloadingApplicationModelConvention.cs +++ /dev/null @@ -1,33 +0,0 @@ -// 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; -using System.Linq; -using Microsoft.AspNetCore.Mvc.ApplicationModels; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public class WebApiOverloadingApplicationModelConvention : IActionModelConvention - { - public void Apply(ActionModel action) - { - if (action == null) - { - throw new ArgumentNullException(nameof(action)); - } - - if (IsConventionApplicable(action.Controller)) - { - foreach (var actionSelectorModel in action.Selectors) - { - actionSelectorModel.ActionConstraints.Add(new OverloadActionConstraint()); - } - } - } - - private bool IsConventionApplicable(ControllerModel controller) - { - return controller.Attributes.OfType().Any(); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiParameterConventionsApplicationModelConvention.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiParameterConventionsApplicationModelConvention.cs deleted file mode 100644 index 473ee95bb7..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiParameterConventionsApplicationModelConvention.cs +++ /dev/null @@ -1,90 +0,0 @@ -// 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; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Reflection; -using System.Web.Http; -using Microsoft.AspNetCore.Mvc.ApplicationModels; -using Microsoft.AspNetCore.Mvc.ModelBinding; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public class WebApiParameterConventionsApplicationModelConvention : IActionModelConvention - { - public void Apply(ActionModel action) - { - if (action == null) - { - throw new ArgumentNullException(nameof(action)); - } - - if (IsConventionApplicable(action.Controller)) - { - var optionalParameters = new HashSet(); - var uriBindingSource = (new FromUriAttribute()).BindingSource; - foreach (var parameter in action.Parameters) - { - // Some IBindingSourceMetadata attributes like ModelBinder attribute return null - // as their binding source. Special case to ensure we do not ignore them. - if (parameter.BindingInfo?.BindingSource != null || - parameter.Attributes.OfType().Any()) - { - // This has a binding behavior configured, just leave it alone. - } - else if (CanConvertFromString(parameter.ParameterInfo.ParameterType)) - { - // Simple types are by-default from the URI. - parameter.BindingInfo = parameter.BindingInfo ?? new BindingInfo(); - parameter.BindingInfo.BindingSource = uriBindingSource; - } - else - { - // Complex types are by-default from the body. - parameter.BindingInfo = parameter.BindingInfo ?? new BindingInfo(); - parameter.BindingInfo.BindingSource = BindingSource.Body; - } - - // For all non IOptionalBinderMetadata, which are not URL source (like FromQuery etc.) do not - // participate in overload selection and hence are added to the hashset so that they can be - // ignored in OverloadActionConstraint. - var optionalMetadata = parameter.Attributes.OfType().SingleOrDefault(); - if (parameter.ParameterInfo.HasDefaultValue && parameter.BindingInfo.BindingSource == uriBindingSource || - optionalMetadata != null && optionalMetadata.IsOptional || - optionalMetadata == null && parameter.BindingInfo.BindingSource != uriBindingSource) - { - optionalParameters.Add(parameter.ParameterName); - } - } - - action.Properties.Add("OptionalParameters", optionalParameters); - } - } - - private bool IsConventionApplicable(ControllerModel controller) - { - return controller.Attributes.OfType().Any(); - } - - private static bool CanConvertFromString(Type destinationType) - { - destinationType = Nullable.GetUnderlyingType(destinationType) ?? destinationType; - return IsSimpleType(destinationType) || - TypeDescriptor.GetConverter(destinationType).CanConvertFrom(typeof(string)); - } - - private static bool IsSimpleType(Type type) - { - return type.GetTypeInfo().IsPrimitive || - type.Equals(typeof(decimal)) || - type.Equals(typeof(string)) || - type.Equals(typeof(DateTime)) || - type.Equals(typeof(Guid)) || - type.Equals(typeof(DateTimeOffset)) || - type.Equals(typeof(TimeSpan)) || - type.Equals(typeof(Uri)); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiRoutesApplicationModelConvention.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiRoutesApplicationModelConvention.cs deleted file mode 100644 index cb397dcd74..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Conventions/WebApiRoutesApplicationModelConvention.cs +++ /dev/null @@ -1,37 +0,0 @@ -// 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; -using System.Linq; -using Microsoft.AspNetCore.Mvc.ApplicationModels; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public class WebApiRoutesApplicationModelConvention : IControllerModelConvention - { - private readonly string _area; - - public WebApiRoutesApplicationModelConvention(string area) - { - _area = area; - } - - public void Apply(ControllerModel controller) - { - if (controller == null) - { - throw new ArgumentNullException(nameof(controller)); - } - - if (IsConventionApplicable(controller)) - { - controller.RouteValues.Add("area", _area); - } - } - - private bool IsConventionApplicable(ControllerModel controller) - { - return controller.Attributes.OfType().Any(); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ExceptionResult.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ExceptionResult.cs deleted file mode 100644 index ea5a7c86ea..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ExceptionResult.cs +++ /dev/null @@ -1,45 +0,0 @@ -// 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.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace System.Web.Http -{ - /// - /// An action result that returns a response and - /// performs content negotiation on an based on an . - /// - public class ExceptionResult : ObjectResult - { - /// Initializes a new instance of the class. - /// The exception to include in the error. - /// - /// if the error should include exception messages; otherwise, . - /// - public ExceptionResult(Exception exception, bool includeErrorDetail) - : base(new HttpError(exception, includeErrorDetail)) - { - Exception = exception; - IncludeErrorDetail = includeErrorDetail; - } - - /// - /// Gets the exception to include in the error. - /// - public Exception Exception { get; private set; } - - /// - /// Gets a value indicating whether the error should include exception messages. - /// - public bool IncludeErrorDetail { get; private set; } - - /// - public override Task ExecuteResultAsync(ActionContext context) - { - context.HttpContext.Response.StatusCode = StatusCodes.Status500InternalServerError; - return base.ExecuteResultAsync(context); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/FormDataCollectionExtensions.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/FormDataCollectionExtensions.cs deleted file mode 100644 index a9539e83a0..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/FormDataCollectionExtensions.cs +++ /dev/null @@ -1,114 +0,0 @@ -// 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; -using System.Collections.Generic; -using System.Net.Http.Formatting; -using System.Text; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public static class FormDataCollectionExtensions - { - // This is a helper method to use Model Binding over a JQuery syntax. - // Normalize from JQuery to MVC keys. The model binding infrastructure uses MVC keys - // x[] --> x - // [] --> "" - // x[field] --> x.field, where field is not a number - public static string NormalizeJQueryToMvc(string key) - { - if (key == null) - { - return string.Empty; - } - - StringBuilder sb = null; - var i = 0; - while (true) - { - var indexOpen = key.IndexOf('[', i); - if (indexOpen < 0) - { - // Fast path, no normalization needed. - // This skips the string conversion and allocating the string builder. - if (i == 0) - { - return key; - } - sb = sb ?? new StringBuilder(); - sb.Append(key, i, key.Length - i); - break; // no more brackets - } - - sb = sb ?? new StringBuilder(); - sb.Append(key, i, indexOpen - i); // everything up to "[" - - // Find closing bracket. - var indexClose = key.IndexOf(']', indexOpen); - if (indexClose == -1) - { - throw new ArgumentException(Resources.JQuerySyntaxMissingClosingBracket, nameof(key)); - } - - if (indexClose == indexOpen + 1) - { - // Empty bracket. Signifies array. Just remove. - } - else - { - if (char.IsDigit(key[indexOpen + 1])) - { - // array index. Leave unchanged. - sb.Append(key, indexOpen, indexClose - indexOpen + 1); - } - else - { - // Field name. Convert to dot notation. - sb.Append('.'); - sb.Append(key, indexOpen + 1, indexClose - indexOpen - 1); - } - } - - i = indexClose + 1; - if (i >= key.Length) - { - break; // end of string - } - } - return sb.ToString(); - } - - public static IEnumerable> GetJQueryNameValuePairs( - this FormDataCollection formData) - { - if (formData == null) - { - throw new ArgumentNullException(nameof(formData)); - } - - var count = 0; - - foreach (var kv in formData) - { - ThrowIfMaxHttpCollectionKeysExceeded(count); - - var key = NormalizeJQueryToMvc(kv.Key); - var value = kv.Value ?? string.Empty; - yield return new KeyValuePair(key, value); - - count++; - } - } - - private static void ThrowIfMaxHttpCollectionKeysExceeded(int count) - { - if (count >= MediaTypeFormatter.MaxHttpCollectionKeys) - { - var message = Resources.FormatMaxHttpCollectionKeyLimitReached( - MediaTypeFormatter.MaxHttpCollectionKeys, - typeof(MediaTypeFormatter)); - throw new InvalidOperationException(message); - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Formatters/HttpResponseMessageOutputFormatter.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Formatters/HttpResponseMessageOutputFormatter.cs deleted file mode 100644 index f224fa4c49..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Formatters/HttpResponseMessageOutputFormatter.cs +++ /dev/null @@ -1,79 +0,0 @@ -// 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; -using System.Linq; -using System.Net.Http; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Features; -using Microsoft.AspNetCore.Mvc.Formatters; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public class HttpResponseMessageOutputFormatter : IOutputFormatter - { - public bool CanWriteResult(OutputFormatterCanWriteContext context) - { - return context.Object is HttpResponseMessage; - } - - public async Task WriteAsync(OutputFormatterWriteContext context) - { - var response = context.HttpContext.Response; - - var responseMessage = context.Object as HttpResponseMessage; - if (responseMessage == null) - { - var message = Resources.FormatHttpResponseMessageFormatter_UnsupportedType( - nameof(HttpResponseMessageOutputFormatter), - nameof(HttpResponseMessage)); - - throw new InvalidOperationException(message); - } - - using (responseMessage) - { - response.StatusCode = (int)responseMessage.StatusCode; - - var responseFeature = context.HttpContext.Features.Get(); - if (responseFeature != null) - { - responseFeature.ReasonPhrase = responseMessage.ReasonPhrase; - } - - var responseHeaders = responseMessage.Headers; - - // Ignore the Transfer-Encoding header if it is just "chunked". - // We let the host decide about whether the response should be chunked or not. - if (responseHeaders.TransferEncodingChunked == true && - responseHeaders.TransferEncoding.Count == 1) - { - responseHeaders.TransferEncoding.Clear(); - } - - foreach (var header in responseHeaders) - { - response.Headers.Append(header.Key, header.Value.ToArray()); - } - - if (responseMessage.Content != null) - { - var contentHeaders = responseMessage.Content.Headers; - - // Copy the response content headers only after ensuring they are complete. - // We ask for Content-Length first because HttpContent lazily computes this - // and only afterwards writes the value into the content headers. - var unused = contentHeaders.ContentLength; - - foreach (var header in contentHeaders) - { - response.Headers.Append(header.Key, header.Value.ToArray()); - } - - await responseMessage.Content.CopyToAsync(response.Body); - } - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpError.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpError.cs deleted file mode 100644 index f86b30da3a..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpError.cs +++ /dev/null @@ -1,285 +0,0 @@ -// 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.Collections.Generic; -using System.Linq; -using System.Xml; -using System.Xml.Schema; -using System.Xml.Serialization; -using Microsoft.AspNetCore.Mvc.ModelBinding; -using ShimResources = Microsoft.AspNetCore.Mvc.WebApiCompatShim.Resources; - -namespace System.Web.Http -{ - /// - /// Defines a serializable container for storing error information. This information is stored - /// as key/value pairs. The dictionary keys to look up standard error information are available - /// on the type. - /// - [XmlRoot("Error")] - public sealed class HttpError : Dictionary, IXmlSerializable - { - /// - /// Initializes a new instance of the class. - /// - public HttpError() - : base(StringComparer.OrdinalIgnoreCase) - { - } - - /// - /// Initializes a new instance of the class containing error message - /// . - /// - /// The error message to associate with this instance. - public HttpError(string message) - : this() - { - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - - Message = message; - } - - /// - /// Initializes a new instance of the class for . - /// - /// The exception to use for error information. - /// - /// true to include the exception information in the error;false otherwise. - /// - public HttpError(Exception exception, bool includeErrorDetail) - : this() - { - if (exception == null) - { - throw new ArgumentNullException(nameof(exception)); - } - - Message = ShimResources.HttpError_GenericError; - - if (includeErrorDetail) - { - Add(HttpErrorKeys.ExceptionMessageKey, exception.Message); - Add(HttpErrorKeys.ExceptionTypeKey, exception.GetType().FullName); - Add(HttpErrorKeys.StackTraceKey, exception.StackTrace); - if (exception.InnerException != null) - { - Add(HttpErrorKeys.InnerExceptionKey, new HttpError(exception.InnerException, includeErrorDetail)); - } - } - } - - /// - /// Initializes a new instance of the class for . - /// - /// The invalid model state to use for error information. - /// - /// true to include exception messages in the error; false otherwise. - /// - public HttpError(ModelStateDictionary modelState, bool includeErrorDetail) - : this() - { - if (modelState == null) - { - throw new ArgumentNullException(nameof(modelState)); - } - - if (modelState.IsValid) - { - throw new ArgumentException(ShimResources.HttpError_ValidModelState, nameof(modelState)); - } - - Message = ShimResources.HttpError_BadRequest; - - var modelStateError = new HttpError(); - foreach (KeyValuePair keyModelStatePair in modelState) - { - var key = keyModelStatePair.Key; - var errors = keyModelStatePair.Value.Errors; - if (errors != null && errors.Count > 0) - { - var errorMessages = errors.Select(error => - { - if (includeErrorDetail && error.Exception != null) - { - return error.Exception.Message; - } - else - { - return - string.IsNullOrEmpty(error.ErrorMessage) ? - ShimResources.HttpError_GenericError : - error.ErrorMessage; - } - }).ToArray(); - modelStateError.Add(key, errorMessages); - } - } - - Add(HttpErrorKeys.ModelStateKey, modelStateError); - } - - /// - /// The high-level, user-visible message explaining the cause of the error. Information carried in this field - /// should be considered public in that it will go over the wire regardless of the value of error detail - /// policy. As a result care should be taken not to disclose sensitive information about the server or the - /// application. - /// - public string Message - { - get { return GetPropertyValue(HttpErrorKeys.MessageKey); } - set { this[HttpErrorKeys.MessageKey] = value; } - } - - /// - /// The containing information about the errors that occurred during model binding. - /// - /// - /// The inclusion of information carried in the is - /// controlled by the error detail policy. All other information in the - /// should be considered public in that it will go over the wire. As a result care should be taken not to - /// disclose sensitive information about the server or the application. - /// - public HttpError ModelState - { - get { return GetPropertyValue(HttpErrorKeys.ModelStateKey); } - } - - /// - /// A detailed description of the error intended for the developer to understand exactly what failed. - /// - /// - /// The inclusion of this field is controlled by the error detail policy. The - /// field is expected to contain information about the server or the application that should not - /// be disclosed broadly. - /// - public string MessageDetail - { - get { return GetPropertyValue(HttpErrorKeys.MessageDetailKey); } - set { this[HttpErrorKeys.MessageDetailKey] = value; } - } - - /// - /// The message of the if available. - /// - /// - /// The inclusion of this field is controlled by the error detail policy. The - /// field is expected to contain information about the server or the application that should not - /// be disclosed broadly. - /// - public string ExceptionMessage - { - get { return GetPropertyValue(HttpErrorKeys.ExceptionMessageKey); } - set { this[HttpErrorKeys.ExceptionMessageKey] = value; } - } - - /// - /// The type of the if available. - /// - /// - /// The inclusion of this field is controlled by the error detail policy. The - /// field is expected to contain information about the server or the application that should not - /// be disclosed broadly. - /// - public string ExceptionType - { - get { return GetPropertyValue(HttpErrorKeys.ExceptionTypeKey); } - set { this[HttpErrorKeys.ExceptionTypeKey] = value; } - } - - /// - /// The stack trace information associated with this instance if available. - /// - /// - /// The inclusion of this field is controlled by the error detail policy. The - /// field is expected to contain information about the server or the application that should not - /// be disclosed broadly. - /// - public string StackTrace - { - get { return GetPropertyValue(HttpErrorKeys.StackTraceKey); } - set { this[HttpErrorKeys.StackTraceKey] = value; } - } - - /// - /// The inner associated with this instance if available. - /// - /// - /// The inclusion of this field is controlled by the error detail policy. The - /// field is expected to contain information about the server or the application that should not - /// be disclosed broadly. - /// - public HttpError InnerException - { - get { return GetPropertyValue(HttpErrorKeys.InnerExceptionKey); } - } - - /// - /// Gets a particular property value from this error instance. - /// - /// The type of the property. - /// The name of the error property. - /// The value of the error property. - public TValue GetPropertyValue(string key) - { - object value; - if (TryGetValue(key, out value) && value is TValue) - { - return (TValue)value; - } - - return default(TValue); - } - - XmlSchema IXmlSerializable.GetSchema() - { - return null; - } - - void IXmlSerializable.ReadXml(XmlReader reader) - { - if (reader.IsEmptyElement) - { - reader.Read(); - return; - } - - reader.ReadStartElement(); - while (reader.NodeType != System.Xml.XmlNodeType.EndElement) - { - var key = XmlConvert.DecodeName(reader.LocalName); - var value = reader.ReadInnerXml(); - - Add(key, value); - reader.MoveToContent(); - } - reader.ReadEndElement(); - } - - void IXmlSerializable.WriteXml(XmlWriter writer) - { - foreach (var keyValuePair in this) - { - var key = keyValuePair.Key; - var value = keyValuePair.Value; - writer.WriteStartElement(XmlConvert.EncodeLocalName(key)); - if (value != null) - { - var innerError = value as HttpError; - if (innerError == null) - { - writer.WriteValue(value); - } - else - { - ((IXmlSerializable)innerError).WriteXml(writer); - } - } - writer.WriteEndElement(); - } - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpErrorKeys.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpErrorKeys.cs deleted file mode 100644 index 48cb0dec17..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpErrorKeys.cs +++ /dev/null @@ -1,56 +0,0 @@ -// 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. - -namespace System.Web.Http -{ - /// - /// Provides keys to look up error information stored in the dictionary. - /// - public static class HttpErrorKeys - { - /// - /// Provides a key for the Message. - /// - public static readonly string MessageKey = "Message"; - - /// - /// Provides a key for the MessageDetail. - /// - public static readonly string MessageDetailKey = "MessageDetail"; - - /// - /// Provides a key for the ModelState. - /// - public static readonly string ModelStateKey = "ModelState"; - - /// - /// Provides a key for the ExceptionMessage. - /// - public static readonly string ExceptionMessageKey = "ExceptionMessage"; - - /// - /// Provides a key for the ExceptionType. - /// - public static readonly string ExceptionTypeKey = "ExceptionType"; - - /// - /// Provides a key for the StackTrace. - /// - public static readonly string StackTraceKey = "StackTrace"; - - /// - /// Provides a key for the InnerException. - /// - public static readonly string InnerExceptionKey = "InnerException"; - - /// - /// Provides a key for the MessageLanguage. - /// - public static readonly string MessageLanguageKey = "MessageLanguage"; - - /// - /// Provides a key for the ErrorCode. - /// - public static readonly string ErrorCodeKey = "ErrorCode"; - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageExtensions.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageExtensions.cs deleted file mode 100644 index 1879f81e1d..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageExtensions.cs +++ /dev/null @@ -1,521 +0,0 @@ -// 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.Collections.Generic; -using System.Net.Http.Formatting; -using System.Net.Http.Headers; -using System.Web.Http; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc.ModelBinding; -using Microsoft.AspNetCore.Mvc.WebApiCompatShim; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; -using ShimResources = Microsoft.AspNetCore.Mvc.WebApiCompatShim.Resources; - -namespace System.Net.Http -{ - /// - /// Provides extension methods for the class. - /// - public static class HttpRequestMessageExtensions - { - /// - /// Helper method that performs content negotiation and creates a - /// representing an error with an instance of wrapping an - /// with message . If no formatter is found, this method - /// returns a response with status 406 NotAcceptable. - /// - /// - /// This method requires that has been associated with an instance of - /// . - /// - /// The request. - /// The status code of the created response. - /// The error message. - /// - /// An error response with error message and status code - /// . - /// - public static HttpResponseMessage CreateErrorResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - string message) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - - return request.CreateErrorResponse(statusCode, new HttpError(message)); - } - - /// - /// Helper method that performs content negotiation and creates a - /// representing an error with an instance of wrapping an - /// with error message for exception - /// . If no formatter is found, this method returns a response with status 406 - /// NotAcceptable. - /// - /// - /// This method requires that has been associated with an instance of - /// . - /// - /// The request. - /// The status code of the created response. - /// The error message. - /// The exception. - /// An error response for with error message - /// and status code . - public static HttpResponseMessage CreateErrorResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - string message, - Exception exception) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (message == null) - { - throw new ArgumentNullException(nameof(message)); - } - - if (exception == null) - { - throw new ArgumentNullException(nameof(exception)); - } - - var error = new HttpError(exception, includeErrorDetail: false) { Message = message }; - return request.CreateErrorResponse(statusCode, error); - } - - /// - /// Helper method that performs content negotiation and creates a - /// representing an error with an instance of wrapping an - /// for exception . If no formatter is found, this method - /// returns a response with status 406 NotAcceptable. - /// - /// - /// This method requires that has been associated with an instance of - /// . - /// - /// The request. - /// The status code of the created response. - /// The exception. - /// - /// An error response for with status code . - /// - public static HttpResponseMessage CreateErrorResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - Exception exception) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (exception == null) - { - throw new ArgumentNullException(nameof(exception)); - } - - return request.CreateErrorResponse(statusCode, new HttpError(exception, includeErrorDetail: false)); - } - - /// - /// Helper method that performs content negotiation and creates a - /// representing an error with an instance of wrapping an - /// for model state . If no formatter is found, this - /// method returns a response with status 406 NotAcceptable. - /// - /// - /// This method requires that has been associated with an instance of - /// . - /// - /// The request. - /// The status code of the created response. - /// The model state. - /// - /// An error response for with status code . - /// - public static HttpResponseMessage CreateErrorResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - ModelStateDictionary modelState) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (modelState == null) - { - throw new ArgumentNullException(nameof(modelState)); - } - - return request.CreateErrorResponse(statusCode, new HttpError(modelState, includeErrorDetail: false)); - } - - /// - /// Helper method that performs content negotiation and creates a - /// representing an error with an instance of wrapping - /// as the content. If no formatter is found, this method returns a response with status 406 NotAcceptable. - /// - /// - /// This method requires that has been associated with an instance of - /// . - /// - /// The request. - /// The status code of the created response. - /// The error to wrap. - /// - /// An error response wrapping with status code . - /// - public static HttpResponseMessage CreateErrorResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - HttpError error) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (error == null) - { - throw new ArgumentNullException(nameof(error)); - } - - return request.CreateResponse(statusCode, error); - } - - /// - /// Helper method that performs content negotiation and creates a with an - /// instance of as the content and - /// as the status code if a formatter can be found. If no formatter is found, this method returns a response - /// with status 406 NotAcceptable. - /// - /// - /// This method requires that has been associated with an instance of - /// . - /// - /// The type of the value. - /// The request. - /// The value to wrap. Can be null. - /// - /// A response wrapping with status code. - /// - public static HttpResponseMessage CreateResponse(this HttpRequestMessage request, T value) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - return request.CreateResponse(HttpStatusCode.OK, value, formatters: null); - } - - /// - /// Helper method that performs content negotiation and creates a with an - /// instance of as the content if a formatter can be found. If no formatter is - /// found, this method returns a response with status 406 NotAcceptable. - /// configuration. - /// - /// - /// This method requires that has been associated with an instance of - /// . - /// - /// The type of the value. - /// The request. - /// The status code of the created response. - /// The value to wrap. Can be null. - /// A response wrapping with . - public static HttpResponseMessage CreateResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - T value) - { - return request.CreateResponse(statusCode, value, formatters: null); - } - - /// - /// Helper method that performs content negotiation and creates a with an - /// instance of as the content if a formatter can be found. If no formatter is - /// found, this method returns a response with status 406 NotAcceptable. - /// - /// - /// This method will get the instance associated with . - /// - /// The type of the value. - /// The request. - /// The status code of the created response. - /// The value to wrap. Can be null. - /// The set of objects from which to choose. - /// A response wrapping with . - public static HttpResponseMessage CreateResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - T value, - IEnumerable formatters) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - var context = GetHttpContext(request); - - if (formatters == null) - { - // Get the default formatters from options - var options = context.RequestServices.GetRequiredService>(); - formatters = options.Value.Formatters; - } - - var contentNegotiator = context.RequestServices.GetRequiredService(); - - var result = contentNegotiator.Negotiate(typeof(T), request, formatters); - if (result?.Formatter == null) - { - // Return a 406 when we're actually performing conneg and it fails to find a formatter. - return new HttpResponseMessage(HttpStatusCode.NotAcceptable) - { - RequestMessage = request - }; - } - else - { - return request.CreateResponse(statusCode, value, result.Formatter, result.MediaType); - } - } - - /// - /// Helper method that creates a with an - /// instance containing the provided . The given is used - /// to find an instance of . - /// - /// The type of the value. - /// The request. - /// The status code of the created response. - /// The value to wrap. Can be null. - /// - /// The media type used to look up an instance of . - /// - /// A response wrapping with . - public static HttpResponseMessage CreateResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - T value, - string mediaType) - { - return request.CreateResponse(statusCode, value, new MediaTypeHeaderValue(mediaType)); - } - - /// - /// Helper method that creates a with an - /// instance containing the provided . The given is used - /// to find an instance of . - /// - /// The type of the value. - /// The request. - /// The status code of the created response. - /// The value to wrap. Can be null. - /// - /// The media type used to look up an instance of . - /// - /// A response wrapping with . - public static HttpResponseMessage CreateResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - T value, - MediaTypeHeaderValue mediaType) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (mediaType == null) - { - throw new ArgumentNullException(nameof(mediaType)); - } - - var context = GetHttpContext(request); - - // Get the default formatters from options - var options = context.RequestServices.GetRequiredService>(); - var formatters = options.Value.Formatters; - - var formatter = formatters.FindWriter(typeof(T), mediaType); - if (formatter == null) - { - var message = ShimResources.FormatHttpRequestMessage_CouldNotFindMatchingFormatter( - mediaType.ToString(), - value.GetType()); - throw new InvalidOperationException(message); - } - - return request.CreateResponse(statusCode, value, formatter, mediaType); - } - - /// - /// Helper method that creates a with an - /// instance containing the provided and the given . - /// - /// The type of the value. - /// The request. - /// The status code of the created response. - /// The value to wrap. Can be null. - /// The formatter to use. - /// A response wrapping with . - public static HttpResponseMessage CreateResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - T value, - MediaTypeFormatter formatter) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (formatter == null) - { - throw new ArgumentNullException(nameof(formatter)); - } - - return request.CreateResponse(statusCode, value, formatter, (MediaTypeHeaderValue)null); - } - - /// - /// Helper method that creates a with an - /// instance containing the provided and the given . - /// - /// The type of the value. - /// The request. - /// The status code of the created response. - /// The value to wrap. Can be null. - /// The formatter to use. - /// - /// The media type override to set on the response's content. Can be null. - /// - /// A response wrapping with . - public static HttpResponseMessage CreateResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - T value, - MediaTypeFormatter formatter, - string mediaType) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (value == null) - { - throw new ArgumentNullException(nameof(value)); - } - - if (formatter == null) - { - throw new ArgumentNullException(nameof(formatter)); - } - - var mediaTypeHeader = mediaType != null ? new MediaTypeHeaderValue(mediaType) : null; - return request.CreateResponse(statusCode, value, formatter, mediaTypeHeader); - } - - /// - /// Helper method that creates a with an - /// instance containing the provided and the given . - /// - /// The type of the value. - /// The request. - /// The status code of the created response. - /// The value to wrap. Can be null. - /// The formatter to use. - /// - /// The media type override to set on the response's content. Can be null. - /// - /// A response wrapping with . - public static HttpResponseMessage CreateResponse( - this HttpRequestMessage request, - HttpStatusCode statusCode, - T value, - MediaTypeFormatter formatter, - MediaTypeHeaderValue mediaType) - { - if (request == null) - { - throw new ArgumentNullException(nameof(request)); - } - - if (formatter == null) - { - throw new ArgumentNullException(nameof(formatter)); - } - - var response = new HttpResponseMessage(statusCode) - { - RequestMessage = request, - }; - - response.Content = new ObjectContent(value, formatter, mediaType); - - return response; - } - - private static HttpContext GetHttpContext(HttpRequestMessage request) - { - var context = request.GetProperty(nameof(HttpContext)); - if (context == null) - { - var message = ShimResources.FormatHttpRequestMessage_MustHaveHttpContext( - nameof(HttpRequestMessage), - "HttpRequestMessageHttpContextExtensions.GetHttpRequestMessage"); - throw new InvalidOperationException(message); - } - - return context; - } - - private static T GetProperty(this HttpRequestMessage request, string key) - { - object value; - request.Properties.TryGetValue(key, out value); - - if (value is T) - { - return (T)value; - } - else - { - return default(T); - } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageFeature.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageFeature.cs deleted file mode 100644 index 9937d4d2c3..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageFeature.cs +++ /dev/null @@ -1,77 +0,0 @@ -// 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; -using System.Collections.Generic; -using System.Diagnostics; -using System.Net.Http; -using Microsoft.AspNetCore.Http; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public class HttpRequestMessageFeature : IHttpRequestMessageFeature - { - private readonly HttpContext _httpContext; - private HttpRequestMessage _httpRequestMessage; - - public HttpRequestMessageFeature(HttpContext httpContext) - { - if (httpContext == null) - { - throw new ArgumentNullException(nameof(httpContext)); - } - - _httpContext = httpContext; - } - - public HttpRequestMessage HttpRequestMessage - { - get - { - if (_httpRequestMessage == null) - { - _httpRequestMessage = CreateHttpRequestMessage(_httpContext); - } - - return _httpRequestMessage; - } - - set - { - _httpRequestMessage = value; - } - } - - private static HttpRequestMessage CreateHttpRequestMessage(HttpContext httpContext) - { - var httpRequest = httpContext.Request; - var uriString = - httpRequest.Scheme + "://" + - httpRequest.Host + - httpRequest.PathBase + - httpRequest.Path + - httpRequest.QueryString; - - var message = new HttpRequestMessage(new HttpMethod(httpRequest.Method), uriString); - - // This allows us to pass the message through APIs defined in legacy code and then - // operate on the HttpContext inside. - message.Properties[nameof(HttpContext)] = httpContext; - - message.Content = new StreamContent(httpRequest.Body); - - foreach (var header in httpRequest.Headers) - { - // Every header should be able to fit into one of the two header collections. - // Try message.Headers first since that accepts more of them. - if (!message.Headers.TryAddWithoutValidation(header.Key, (IEnumerable)header.Value)) - { - var added = message.Content.Headers.TryAddWithoutValidation(header.Key, (IEnumerable)header.Value); - Debug.Assert(added); - } - } - - return message; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageHttpContextExtensions.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageHttpContextExtensions.cs deleted file mode 100644 index 36636bb49a..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageHttpContextExtensions.cs +++ /dev/null @@ -1,24 +0,0 @@ -// 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.Net.Http; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Http.Features; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public static class HttpRequestMessageHttpContextExtensions - { - public static HttpRequestMessage GetHttpRequestMessage(this HttpContext httpContext) - { - var feature = httpContext.Features.Get(); - if (feature == null) - { - feature = new HttpRequestMessageFeature(httpContext); - httpContext.Features.Set(feature); - } - - return feature.HttpRequestMessage; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageModelBinder.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageModelBinder.cs deleted file mode 100644 index 29fd9aa437..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageModelBinder.cs +++ /dev/null @@ -1,26 +0,0 @@ -// 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.Net.Http; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc.ModelBinding; -using Microsoft.AspNetCore.Mvc.ModelBinding.Validation; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// implementation to bind models of type . - /// - public class HttpRequestMessageModelBinder : IModelBinder - { - /// - public Task BindModelAsync(ModelBindingContext bindingContext) - { - var model = bindingContext.HttpContext.GetHttpRequestMessage(); - bindingContext.ValidationState.Add(model, new ValidationStateEntry() { SuppressValidation = true }); - bindingContext.Result = ModelBindingResult.Success(model); - - return Task.CompletedTask; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageModelBinderProvider.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageModelBinderProvider.cs deleted file mode 100644 index bb06a4d243..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/HttpRequestMessageModelBinderProvider.cs +++ /dev/null @@ -1,25 +0,0 @@ -// 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.Net.Http; -using Microsoft.AspNetCore.Mvc.ModelBinding; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// implementation to bind models of type . - /// - public class HttpRequestMessageModelBinderProvider : IModelBinderProvider - { - /// - public IModelBinder GetBinder(ModelBinderProviderContext context) - { - if (context.Metadata.ModelType == typeof(HttpRequestMessage)) - { - return new HttpRequestMessageModelBinder(); - } - - return null; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/IHttpRequestMessageFeature.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/IHttpRequestMessageFeature.cs deleted file mode 100644 index ecad550a9e..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpRequestMessage/IHttpRequestMessageFeature.cs +++ /dev/null @@ -1,12 +0,0 @@ -// 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.Net.Http; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public interface IHttpRequestMessageFeature - { - HttpRequestMessage HttpRequestMessage { get; set; } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpResponseException.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpResponseException.cs deleted file mode 100644 index 866642f6c5..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpResponseException.cs +++ /dev/null @@ -1,41 +0,0 @@ -// 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.Net; -using System.Net.Http; -using ShimResources = Microsoft.AspNetCore.Mvc.WebApiCompatShim.Resources; - -namespace System.Web.Http -{ - public class HttpResponseException : Exception - { - /// - /// Initializes a new instance of the class. - /// - /// The status code of the response. - public HttpResponseException(HttpStatusCode statusCode) - : this(new HttpResponseMessage(statusCode)) - { - } - - /// - /// Initializes a new instance of the class. - /// - /// The response message. - public HttpResponseException(HttpResponseMessage response) - : base(ShimResources.HttpResponseExceptionMessage) - { - if (response == null) - { - throw new ArgumentNullException(nameof(response)); - } - - Response = response; - } - - /// - /// Gets the to return to the client. - /// - public HttpResponseMessage Response { get; private set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpResponseExceptionActionFilter.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpResponseExceptionActionFilter.cs deleted file mode 100644 index d214ee63b0..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/HttpResponseExceptionActionFilter.cs +++ /dev/null @@ -1,59 +0,0 @@ -// 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; -using System.Net.Http; -using System.Web.Http; -using Microsoft.AspNetCore.Mvc.Filters; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// An action filter that sets to an - /// if the exception type is . - /// This filter runs immediately after the action. - /// - public class HttpResponseExceptionActionFilter : IActionFilter, IOrderedFilter - { - /// - // Return a high number by default so that it runs closest to the action. - public int Order { get; set; } = int.MaxValue - 10; - - /// - public void OnActionExecuting(ActionExecutingContext context) - { - } - - /// - public void OnActionExecuted(ActionExecutedContext context) - { - if (context == null) - { - throw new ArgumentNullException(nameof(context)); - } - - var httpResponseException = context.Exception as HttpResponseException; - if (httpResponseException != null) - { - var request = context.HttpContext.GetHttpRequestMessage(); - var response = httpResponseException.Response; - - if (response != null && response.RequestMessage == null) - { - response.RequestMessage = request; - } - - var objectResult = new ObjectResult(response) - { - DeclaredType = typeof(HttpResponseMessage) - }; - - context.Result = objectResult; - - // Its marked as handled as in webapi because an HttpResponseException - // was considered as a 'success' response. - context.ExceptionHandled = true; - } - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/InternalServerErrorResult.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/InternalServerErrorResult.cs deleted file mode 100644 index 840f439645..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/InternalServerErrorResult.cs +++ /dev/null @@ -1,22 +0,0 @@ -// 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 Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; - -namespace System.Web.Http -{ - /// - /// An action result that returns an empty response. - /// - public class InternalServerErrorResult : StatusCodeResult - { - /// - /// Initializes a new instance of the class. - /// - public InternalServerErrorResult() - : base(StatusCodes.Status500InternalServerError) - { - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/InvalidModelStateResult.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/InvalidModelStateResult.cs deleted file mode 100644 index 7bd992b650..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/InvalidModelStateResult.cs +++ /dev/null @@ -1,51 +0,0 @@ -// 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.Threading.Tasks; -using Microsoft.AspNetCore.Http; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.ModelBinding; - -namespace System.Web.Http -{ - /// - /// An action result that returns a response and performs - /// content negotiation on an based on a . - /// - public class InvalidModelStateResult : ObjectResult - { - /// Initializes a new instance of the class. - /// The model state to include in the error. - /// - /// if the error should include exception messages; otherwise, . - /// - public InvalidModelStateResult(ModelStateDictionary modelState, bool includeErrorDetail) - : base(new HttpError(modelState, includeErrorDetail)) - { - if (modelState == null) - { - throw new ArgumentNullException(nameof(modelState)); - } - - ModelState = modelState; - IncludeErrorDetail = includeErrorDetail; - } - - /// - /// Gets the model state to include in the error. - /// - public ModelStateDictionary ModelState { get; private set; } - - /// - /// Gets a value indicating whether the error should include exception messages. - /// - public bool IncludeErrorDetail { get; private set; } - - /// - public override Task ExecuteResultAsync(ActionContext context) - { - context.HttpContext.Response.StatusCode = StatusCodes.Status400BadRequest; - return base.ExecuteResultAsync(context); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Microsoft.AspNetCore.Mvc.WebApiCompatShim.csproj b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Microsoft.AspNetCore.Mvc.WebApiCompatShim.csproj deleted file mode 100644 index 2396f53372..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Microsoft.AspNetCore.Mvc.WebApiCompatShim.csproj +++ /dev/null @@ -1,21 +0,0 @@ - - - - Provides compatibility in ASP.NET Core MVC with ASP.NET Web API 2 to simplify migration of existing Web API implementations. -Commonly used types: -System.Web.Http.ApiController - netstandard2.0 - $(NoWarn);CS1591 - true - aspnetcore;aspnetcoremvc;aspnetwebapi - - - - - - - - - - - diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/NegotiatedContentResult.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/NegotiatedContentResult.cs deleted file mode 100644 index d828be7387..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/NegotiatedContentResult.cs +++ /dev/null @@ -1,40 +0,0 @@ -// 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.Net; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Mvc; - -namespace System.Web.Http -{ - /// - /// An action result that performs content negotiation. - /// - /// The type of content in the entity body. - public class NegotiatedContentResult : ObjectResult - { - /// - /// Initializes a new instance of the class with the values provided. - /// - /// The HTTP status code for the response message. - /// The content value to negotiate and format in the entity body. - public NegotiatedContentResult(HttpStatusCode statusCode, T content) - : base(content) - { - StatusCode = (int)statusCode; - Content = content; - } - - /// - /// Gets the content value to negotiate and format in the entity body. - /// - public T Content { get; private set; } - - /// - public override Task ExecuteResultAsync(ActionContext context) - { - context.HttpContext.Response.StatusCode = (int)StatusCode; - return base.ExecuteResultAsync(context); - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/OverloadActionConstraint.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/OverloadActionConstraint.cs deleted file mode 100644 index 2ae5b527d0..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/OverloadActionConstraint.cs +++ /dev/null @@ -1,193 +0,0 @@ -// 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; -using System.Collections.Generic; -using System.ComponentModel; -using System.Linq; -using System.Net.Http.Formatting; -using System.Reflection; -using Microsoft.AspNetCore.Mvc.Abstractions; -using Microsoft.AspNetCore.Mvc.ActionConstraints; -using Microsoft.AspNetCore.Mvc.ModelBinding; -using Microsoft.AspNetCore.Routing; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - /// - /// An limiting candidate actions to those for which the request satisfies all - /// non-optional parameters. - /// - public class OverloadActionConstraint : IActionConstraint - { - /// - public int Order => int.MaxValue; - - /// - public bool Accept(ActionConstraintContext context) - { - var candidates = context.Candidates.Select(c => new - { - Action = c, - Parameters = GetOverloadableParameters(c), - }); - - // Combined route value keys and query string keys. These are the values available for overload selection. - var requestKeys = GetCombinedKeys(context.RouteContext); - - // Group candidates by the highest number of keys, and then process them until we find an action - // with all parameters satisfied. - foreach (var group in candidates.GroupBy(c => c.Parameters?.Count ?? 0).OrderByDescending(g => g.Key)) - { - var foundMatch = false; - foreach (var candidate in group) - { - var allFound = true; - if (candidate.Parameters != null) - { - foreach (var parameter in candidate.Parameters) - { - if (!requestKeys.Contains(parameter.Prefix)) - { - if (candidate.Action.Action == context.CurrentCandidate.Action) - { - return false; - } - - allFound = false; - break; - } - } - } - - if (allFound) - { - foundMatch = true; - } - } - - if (foundMatch) - { - return group.Any(c => c.Action.Action == context.CurrentCandidate.Action); - } - } - - return false; - } - - private List GetOverloadableParameters(ActionSelectorCandidate candidate) - { - if (candidate.Action.Parameters == null) - { - return null; - } - - var isOverloaded = false; - foreach (var constraint in candidate.Constraints) - { - if (constraint is OverloadActionConstraint) - { - isOverloaded = true; - } - } - - if (!isOverloaded) - { - return null; - } - - var parameters = new List(); - candidate.Action.Properties.TryGetValue("OptionalParameters", out var optionalParametersObject); - var optionalParameters = (HashSet)optionalParametersObject; - foreach (var parameter in candidate.Action.Parameters) - { - // We only consider parameters that are marked as bound from the URL. - var source = parameter.BindingInfo?.BindingSource; - if (source == null) - { - continue; - } - - if ((source.CanAcceptDataFrom(BindingSource.Path) || - source.CanAcceptDataFrom(BindingSource.Query)) && - CanConvertFromString(parameter.ParameterType)) - { - if (optionalParameters != null) - { - var isOptional = optionalParameters.Contains(parameter.Name); - if (isOptional) - { - // Optional parameters are ignored in overloading. If a parameter doesn't specify that it's - // required then treat it as optional (MVC default). WebAPI parameters will all by-default - // specify themselves as required unless they have a default value. - continue; - } - } - - var prefix = parameter.BindingInfo?.BinderModelName ?? parameter.Name; - - parameters.Add(new OverloadedParameter() - { - ParameterDescriptor = parameter, - Prefix = prefix, - }); - } - } - - return parameters; - } - - private static ISet GetCombinedKeys(RouteContext routeContext) - { - var keys = new HashSet(routeContext.RouteData.Values.Keys, StringComparer.OrdinalIgnoreCase); - keys.Remove("controller"); - keys.Remove("action"); - - var queryString = routeContext.HttpContext.Request.QueryString.ToUriComponent(); - - if (queryString.Length > 0) - { - // We need to chop off the leading '?' - var queryData = new FormDataCollection(queryString.Substring(1)); - - var queryNameValuePairs = queryData.GetJQueryNameValuePairs(); - - if (queryNameValuePairs != null) - { - foreach (var queryNameValuePair in queryNameValuePairs) - { - keys.Add(queryNameValuePair.Key); - } - } - } - - return keys; - } - - private static bool CanConvertFromString(Type destinationType) - { - destinationType = Nullable.GetUnderlyingType(destinationType) ?? destinationType; - return IsSimpleType(destinationType) || - TypeDescriptor.GetConverter(destinationType).CanConvertFrom(typeof(string)); - } - - private static bool IsSimpleType(Type type) - { - return type.GetTypeInfo().IsPrimitive || - type.Equals(typeof(decimal)) || - type.Equals(typeof(string)) || - type.Equals(typeof(DateTime)) || - type.Equals(typeof(Guid)) || - type.Equals(typeof(DateTimeOffset)) || - type.Equals(typeof(TimeSpan)) || - type.Equals(typeof(Uri)); - } - - private class OverloadedParameter - { - public ParameterDescriptor ParameterDescriptor { get; set; } - - public string Prefix { get; set; } - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ParameterBinding/FromUriAttribute.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ParameterBinding/FromUriAttribute.cs deleted file mode 100644 index 0002337087..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ParameterBinding/FromUriAttribute.cs +++ /dev/null @@ -1,32 +0,0 @@ -// 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 Microsoft.AspNetCore.Mvc.ModelBinding; -using WebApiShimResources = Microsoft.AspNetCore.Mvc.WebApiCompatShim.Resources; - -namespace System.Web.Http -{ - /// - /// An attribute that specifies that the value can be bound from the query string or route data. - /// - [AttributeUsage(AttributeTargets.Parameter, AllowMultiple = false, Inherited = true)] - public class FromUriAttribute : - Attribute, - IOptionalBinderMetadata, - IBindingSourceMetadata, - IModelNameProvider - { - private static readonly BindingSource FromUriSource = CompositeBindingSource.Create( - new BindingSource[] { BindingSource.Path, BindingSource.Query }, - WebApiShimResources.BindingSource_URL); - - /// - public BindingSource BindingSource { get { return FromUriSource; } } - - /// - public bool IsOptional { get; set; } - - /// - public string Name { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ParameterBinding/IOptionalBinderMetadata.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ParameterBinding/IOptionalBinderMetadata.cs deleted file mode 100644 index 367fd52614..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ParameterBinding/IOptionalBinderMetadata.cs +++ /dev/null @@ -1,24 +0,0 @@ -// 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. - -namespace Microsoft.AspNetCore.Mvc.ModelBinding -{ - /// - /// - /// An type that designates an optional parameter for the purposes - /// of ASP.NET Web API action overloading. Optional parameters do not participate in overloading, and - /// do not have to have a value for the action to be selected. - /// - /// - /// This has no impact when used without ASP.NET Web API action overloading. - /// - /// - public interface IOptionalBinderMetadata - { - /// - /// Gets a value indicating whether the parameter participates in ASP.NET Web API action overloading. If - /// true, the parameter does not participate in overloading. Otherwise, it does. - /// - bool IsOptional { get; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Properties/AssemblyInfo.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Properties/AssemblyInfo.cs deleted file mode 100644 index a97fe6be81..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Properties/AssemblyInfo.cs +++ /dev/null @@ -1,11 +0,0 @@ -// 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.Runtime.CompilerServices; - -[assembly: TypeForwardedTo(typeof(System.Net.Http.Formatting.ContentNegotiationResult))] -[assembly: TypeForwardedTo(typeof(System.Net.Http.Formatting.DefaultContentNegotiator))] -[assembly: TypeForwardedTo(typeof(System.Net.Http.Formatting.FormDataCollection ))] -[assembly: TypeForwardedTo(typeof(System.Net.Http.Formatting.IContentNegotiator))] -[assembly: TypeForwardedTo(typeof(System.Net.Http.Formatting.MediaTypeFormatterMatch))] -[assembly: TypeForwardedTo(typeof(System.Net.Http.Formatting.MediaTypeFormatterMatchRanking))] diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Properties/Resources.Designer.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Properties/Resources.Designer.cs deleted file mode 100644 index 508a740cb9..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Properties/Resources.Designer.cs +++ /dev/null @@ -1,184 +0,0 @@ -// -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - using System.Globalization; - using System.Reflection; - using System.Resources; - - internal static class Resources - { - private static readonly ResourceManager _resourceManager - = new ResourceManager("Microsoft.AspNetCore.Mvc.WebApiCompatShim.Resources", typeof(Resources).GetTypeInfo().Assembly); - - /// - /// The request is invalid. - /// - internal static string HttpError_BadRequest - { - get => GetString("HttpError_BadRequest"); - } - - /// - /// The request is invalid. - /// - internal static string FormatHttpError_BadRequest() - => GetString("HttpError_BadRequest"); - - /// - /// An error has occurred. - /// - internal static string HttpError_GenericError - { - get => GetString("HttpError_GenericError"); - } - - /// - /// An error has occurred. - /// - internal static string FormatHttpError_GenericError() - => GetString("HttpError_GenericError"); - - /// - /// The model state is valid. - /// - internal static string HttpError_ValidModelState - { - get => GetString("HttpError_ValidModelState"); - } - - /// - /// The model state is valid. - /// - internal static string FormatHttpError_ValidModelState() - => GetString("HttpError_ValidModelState"); - - /// - /// Could not find a formatter matching the media type '{0}' that can write an instance of '{1}'. - /// - internal static string HttpRequestMessage_CouldNotFindMatchingFormatter - { - get => GetString("HttpRequestMessage_CouldNotFindMatchingFormatter"); - } - - /// - /// Could not find a formatter matching the media type '{0}' that can write an instance of '{1}'. - /// - internal static string FormatHttpRequestMessage_CouldNotFindMatchingFormatter(object p0, object p1) - => string.Format(CultureInfo.CurrentCulture, GetString("HttpRequestMessage_CouldNotFindMatchingFormatter"), p0, p1); - - /// - /// The {0} instance is not properly initialized. Use {1} to create an {0} for the current request. - /// - internal static string HttpRequestMessage_MustHaveHttpContext - { - get => GetString("HttpRequestMessage_MustHaveHttpContext"); - } - - /// - /// The {0} instance is not properly initialized. Use {1} to create an {0} for the current request. - /// - internal static string FormatHttpRequestMessage_MustHaveHttpContext(object p0, object p1) - => string.Format(CultureInfo.CurrentCulture, GetString("HttpRequestMessage_MustHaveHttpContext"), p0, p1); - - /// - /// The {0} only supports writing objects of type {1}. - /// - internal static string HttpResponseMessageFormatter_UnsupportedType - { - get => GetString("HttpResponseMessageFormatter_UnsupportedType"); - } - - /// - /// The {0} only supports writing objects of type {1}. - /// - internal static string FormatHttpResponseMessageFormatter_UnsupportedType(object p0, object p1) - => string.Format(CultureInfo.CurrentCulture, GetString("HttpResponseMessageFormatter_UnsupportedType"), p0, p1); - - /// - /// The key is invalid JQuery syntax because it is missing a closing bracket. - /// - internal static string JQuerySyntaxMissingClosingBracket - { - get => GetString("JQuerySyntaxMissingClosingBracket"); - } - - /// - /// The key is invalid JQuery syntax because it is missing a closing bracket. - /// - internal static string FormatJQuerySyntaxMissingClosingBracket() - => GetString("JQuerySyntaxMissingClosingBracket"); - - /// - /// The number of keys in a NameValueCollection has exceeded the limit of '{0}'. You can adjust it by modifying the MaxHttpCollectionKeys property on the '{1}' class. - /// - internal static string MaxHttpCollectionKeyLimitReached - { - get => GetString("MaxHttpCollectionKeyLimitReached"); - } - - /// - /// The number of keys in a NameValueCollection has exceeded the limit of '{0}'. You can adjust it by modifying the MaxHttpCollectionKeys property on the '{1}' class. - /// - internal static string FormatMaxHttpCollectionKeyLimitReached(object p0, object p1) - => string.Format(CultureInfo.CurrentCulture, GetString("MaxHttpCollectionKeyLimitReached"), p0, p1); - - /// - /// Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details. - /// - internal static string HttpResponseExceptionMessage - { - get => GetString("HttpResponseExceptionMessage"); - } - - /// - /// Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details. - /// - internal static string FormatHttpResponseExceptionMessage() - => GetString("HttpResponseExceptionMessage"); - - /// - /// Failed to generate a URL using route '{0}'. - /// - internal static string CreatedAtRoute_RouteFailed - { - get => GetString("CreatedAtRoute_RouteFailed"); - } - - /// - /// Failed to generate a URL using route '{0}'. - /// - internal static string FormatCreatedAtRoute_RouteFailed(object p0) - => string.Format(CultureInfo.CurrentCulture, GetString("CreatedAtRoute_RouteFailed"), p0); - - /// - /// URL - /// - internal static string BindingSource_URL - { - get => GetString("BindingSource_URL"); - } - - /// - /// URL - /// - internal static string FormatBindingSource_URL() - => GetString("BindingSource_URL"); - - private static string GetString(string name, params string[] formatterNames) - { - var value = _resourceManager.GetString(name); - - System.Diagnostics.Debug.Assert(value != null); - - if (formatterNames != null) - { - for (var i = 0; i < formatterNames.Length; i++) - { - value = value.Replace("{" + formatterNames[i] + "}", "{" + i + "}"); - } - } - - return value; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Resources.resx b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Resources.resx deleted file mode 100644 index f4448a3035..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Resources.resx +++ /dev/null @@ -1,153 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - text/microsoft-resx - - - 2.0 - - - System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - - - The request is invalid. - - - An error has occurred. - - - The model state is valid. - - - Could not find a formatter matching the media type '{0}' that can write an instance of '{1}'. - - - The {0} instance is not properly initialized. Use {1} to create an {0} for the current request. - - - The {0} only supports writing objects of type {1}. - - - The key is invalid JQuery syntax because it is missing a closing bracket. - - - The number of keys in a NameValueCollection has exceeded the limit of '{0}'. You can adjust it by modifying the MaxHttpCollectionKeys property on the '{1}' class. - - - Processing of the HTTP request resulted in an exception. Please see the HTTP response returned by the 'Response' property of this exception for details. - - - Failed to generate a URL using route '{0}'. - - - URL - - \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ResponseMessageResult.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ResponseMessageResult.cs deleted file mode 100644 index c771faa632..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/ResponseMessageResult.cs +++ /dev/null @@ -1,34 +0,0 @@ -// 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.Net.Http; -using Microsoft.AspNetCore.Mvc; - -namespace System.Web.Http -{ - /// - /// An action result that returns a specified response message. - /// - public class ResponseMessageResult : ObjectResult - { - /// - /// Initializes a new instance of the class. - /// - /// The response message. - public ResponseMessageResult(HttpResponseMessage response) - : base(response) - { - if (response == null) - { - throw new ArgumentNullException(nameof(response)); - } - - Response = response; - } - - /// - /// Gets the response message. - /// - public HttpResponseMessage Response { get; private set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Routing/WebApiCompatShimRouteBuilderExtensions.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Routing/WebApiCompatShimRouteBuilderExtensions.cs deleted file mode 100644 index f16f2f5c61..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/Routing/WebApiCompatShimRouteBuilderExtensions.cs +++ /dev/null @@ -1,70 +0,0 @@ -// 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.Collections.Generic; -using Microsoft.AspNetCore.Mvc.WebApiCompatShim; -using Microsoft.AspNetCore.Routing; -using Microsoft.AspNetCore.Routing.Constraints; - -namespace Microsoft.AspNetCore.Builder -{ - public static class WebApiCompatShimRouteBuilderExtensions - { - public static IRouteBuilder MapWebApiRoute( - this IRouteBuilder routeCollectionBuilder, - string name, - string template) - { - return MapWebApiRoute(routeCollectionBuilder, name, template, defaults: null); - } - - public static IRouteBuilder MapWebApiRoute( - this IRouteBuilder routeCollectionBuilder, - string name, - string template, - object defaults) - { - return MapWebApiRoute(routeCollectionBuilder, name, template, defaults, constraints: null); - } - - public static IRouteBuilder MapWebApiRoute( - this IRouteBuilder routeCollectionBuilder, - string name, - string template, - object defaults, - object constraints) - { - return MapWebApiRoute(routeCollectionBuilder, name, template, defaults, constraints, dataTokens: null); - } - - public static IRouteBuilder MapWebApiRoute( - this IRouteBuilder routeCollectionBuilder, - string name, - string template, - object defaults, - object constraints, - object dataTokens) - { - var mutableDefaults = ObjectToDictionary(defaults); - mutableDefaults.Add("area", WebApiCompatShimOptionsSetup.DefaultAreaName); - - var mutableConstraints = ObjectToDictionary(constraints); - mutableConstraints.Add("area", new RequiredRouteConstraint()); - - return routeCollectionBuilder.MapRoute(name, template, mutableDefaults, mutableConstraints, dataTokens); - } - - private static IDictionary ObjectToDictionary(object value) - { - var dictionary = value as IDictionary; - if (dictionary != null) - { - return new RouteValueDictionary(dictionary); - } - else - { - return new RouteValueDictionary(value); - } - } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/WebApiCompatShimMvcBuilderExtensions.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/WebApiCompatShimMvcBuilderExtensions.cs deleted file mode 100644 index 1fa6a5fd02..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/WebApiCompatShimMvcBuilderExtensions.cs +++ /dev/null @@ -1,26 +0,0 @@ -// 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.Net.Http.Formatting; -using Microsoft.AspNetCore.Mvc; -using Microsoft.AspNetCore.Mvc.WebApiCompatShim; -using Microsoft.Extensions.DependencyInjection.Extensions; -using Microsoft.Extensions.Options; - -namespace Microsoft.Extensions.DependencyInjection -{ - public static class WebApiCompatShimMvcBuilderExtensions - { - public static IMvcBuilder AddWebApiConventions(this IMvcBuilder builder) - { - builder.Services.TryAddEnumerable( - ServiceDescriptor.Transient, WebApiCompatShimOptionsSetup>()); - builder.Services.TryAddEnumerable( - ServiceDescriptor.Transient, WebApiCompatShimOptionsSetup>()); - - builder.Services.TryAddSingleton(); - - return builder; - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/WebApiCompatShimOptions.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/WebApiCompatShimOptions.cs deleted file mode 100644 index c18b8a2be5..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/WebApiCompatShimOptions.cs +++ /dev/null @@ -1,19 +0,0 @@ -// 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; -using System.Net.Http.Formatting; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public class WebApiCompatShimOptions - { - public WebApiCompatShimOptions() - { - // Start with an empty collection, our options setup will add the default formatters. - Formatters = new MediaTypeFormatterCollection(Enumerable.Empty()); - } - - public MediaTypeFormatterCollection Formatters { get; set; } - } -} \ No newline at end of file diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/WebApiCompatShimOptionsSetup.cs b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/WebApiCompatShimOptionsSetup.cs deleted file mode 100644 index 1cd98c2ad7..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/WebApiCompatShimOptionsSetup.cs +++ /dev/null @@ -1,46 +0,0 @@ -// 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.Net.Http; -using System.Net.Http.Formatting; -using Microsoft.AspNetCore.Mvc.ModelBinding; -using Microsoft.Extensions.DependencyInjection; -using Microsoft.Extensions.Options; - -namespace Microsoft.AspNetCore.Mvc.WebApiCompatShim -{ - public class WebApiCompatShimOptionsSetup - : IConfigureOptions, IConfigureOptions - { - public static readonly string DefaultAreaName = "api"; - - public string Name { get; set; } - - public void Configure(MvcOptions options) - { - // Add webapi behaviors to controllers with the appropriate attributes - options.Conventions.Add(new WebApiActionConventionsApplicationModelConvention()); - options.Conventions.Add(new WebApiParameterConventionsApplicationModelConvention()); - options.Conventions.Add(new WebApiOverloadingApplicationModelConvention()); - options.Conventions.Add(new WebApiRoutesApplicationModelConvention(area: DefaultAreaName)); - - // Add an action filter for handling the HttpResponseException. - options.Filters.Add(new HttpResponseExceptionActionFilter()); - - // Add a model binder to be able to bind HttpRequestMessage - options.ModelBinderProviders.Insert(0, new HttpRequestMessageModelBinderProvider()); - - // Add a formatter to write out an HttpResponseMessage to the response - options.OutputFormatters.Insert(0, new HttpResponseMessageOutputFormatter()); - - options.ModelMetadataDetailsProviders.Add(new SuppressChildValidationMetadataProvider(typeof(HttpRequestMessage))); - options.ModelMetadataDetailsProviders.Add(new SuppressChildValidationMetadataProvider(typeof(HttpResponseMessage))); - } - - public void Configure(WebApiCompatShimOptions options) - { - // Add the default formatters - options.Formatters.AddRange(new MediaTypeFormatterCollection()); - } - } -} diff --git a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/baseline.netcore.json b/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/baseline.netcore.json deleted file mode 100644 index cd830febca..0000000000 --- a/src/Microsoft.AspNetCore.Mvc.WebApiCompatShim/baseline.netcore.json +++ /dev/null @@ -1,3166 +0,0 @@ -{ - "AssemblyIdentity": "Microsoft.AspNetCore.Mvc.WebApiCompatShim, Version=2.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60", - "Types": [ - { - "Name": "System.Net.Http.HttpRequestMessageExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "CreateErrorResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "message", - "Type": "System.String" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateErrorResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "message", - "Type": "System.String" - }, - { - "Name": "exception", - "Type": "System.Exception" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateErrorResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "exception", - "Type": "System.Exception" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateErrorResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "modelState", - "Type": "Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateErrorResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "error", - "Type": "System.Web.Http.HttpError" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreateResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "value", - "Type": "T0" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "CreateResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "value", - "Type": "T0" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "CreateResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "value", - "Type": "T0" - }, - { - "Name": "formatters", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "CreateResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "value", - "Type": "T0" - }, - { - "Name": "mediaType", - "Type": "System.String" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "CreateResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "value", - "Type": "T0" - }, - { - "Name": "mediaType", - "Type": "System.Net.Http.Headers.MediaTypeHeaderValue" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "CreateResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "value", - "Type": "T0" - }, - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "CreateResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "value", - "Type": "T0" - }, - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - }, - { - "Name": "mediaType", - "Type": "System.String" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "CreateResponse", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "value", - "Type": "T0" - }, - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - }, - { - "Name": "mediaType", - "Type": "System.Net.Http.Headers.MediaTypeHeaderValue" - } - ], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.ApiController", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "ImplementedInterfaces": [ - "System.IDisposable" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_ActionContext", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.ActionContext", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ControllerContext", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.ControllerContext", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ControllerContext", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Mvc.ControllerContext" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Context", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Http.HttpContext", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_MetadataProvider", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_MetadataProvider", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Mvc.ModelBinding.IModelMetadataProvider" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ObjectValidator", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IObjectModelValidator", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ObjectValidator", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Mvc.ModelBinding.Validation.IObjectModelValidator" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ModelState", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Request", - "Parameters": [], - "ReturnType": "System.Net.Http.HttpRequestMessage", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Request", - "Parameters": [ - { - "Name": "value", - "Type": "System.Net.Http.HttpRequestMessage" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Url", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.IUrlHelper", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Url", - "Parameters": [ - { - "Name": "value", - "Type": "Microsoft.AspNetCore.Mvc.IUrlHelper" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_User", - "Parameters": [], - "ReturnType": "System.Security.Principal.IPrincipal", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "BadRequest", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.BadRequestResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "BadRequest", - "Parameters": [ - { - "Name": "message", - "Type": "System.String" - } - ], - "ReturnType": "System.Web.Http.BadRequestErrorMessageResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "BadRequest", - "Parameters": [ - { - "Name": "modelState", - "Type": "Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary" - } - ], - "ReturnType": "System.Web.Http.InvalidModelStateResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Conflict", - "Parameters": [], - "ReturnType": "System.Web.Http.ConflictResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Content", - "Parameters": [ - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "value", - "Type": "T0" - } - ], - "ReturnType": "System.Web.Http.NegotiatedContentResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "Created", - "Parameters": [ - { - "Name": "location", - "Type": "System.String" - }, - { - "Name": "content", - "Type": "System.Object" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.CreatedResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Created", - "Parameters": [ - { - "Name": "uri", - "Type": "System.Uri" - }, - { - "Name": "content", - "Type": "System.Object" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.CreatedResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "CreatedAtRoute", - "Parameters": [ - { - "Name": "routeName", - "Type": "System.String" - }, - { - "Name": "routeValues", - "Type": "System.Object" - }, - { - "Name": "content", - "Type": "System.Object" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.CreatedAtRouteResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "InternalServerError", - "Parameters": [], - "ReturnType": "System.Web.Http.InternalServerErrorResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "InternalServerError", - "Parameters": [ - { - "Name": "exception", - "Type": "System.Exception" - } - ], - "ReturnType": "System.Web.Http.ExceptionResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Json", - "Parameters": [ - { - "Name": "content", - "Type": "T0" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.JsonResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "Json", - "Parameters": [ - { - "Name": "content", - "Type": "T0" - }, - { - "Name": "serializerSettings", - "Type": "Newtonsoft.Json.JsonSerializerSettings" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.JsonResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "Json", - "Parameters": [ - { - "Name": "content", - "Type": "T0" - }, - { - "Name": "serializerSettings", - "Type": "Newtonsoft.Json.JsonSerializerSettings" - }, - { - "Name": "encoding", - "Type": "System.Text.Encoding" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.JsonResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "NotFound", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.NotFoundResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Ok", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.OkResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Ok", - "Parameters": [ - { - "Name": "content", - "Type": "T0" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.OkObjectResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "Redirect", - "Parameters": [ - { - "Name": "location", - "Type": "System.String" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.RedirectResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Redirect", - "Parameters": [ - { - "Name": "location", - "Type": "System.Uri" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.RedirectResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "RedirectToRoute", - "Parameters": [ - { - "Name": "routeName", - "Type": "System.String" - }, - { - "Name": "routeValues", - "Type": "System.Object" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.RedirectToRouteResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ResponseMessage", - "Parameters": [ - { - "Name": "response", - "Type": "System.Net.Http.HttpResponseMessage" - } - ], - "ReturnType": "System.Web.Http.ResponseMessageResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "StatusCode", - "Parameters": [ - { - "Name": "status", - "Type": "System.Net.HttpStatusCode" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.StatusCodeResult", - "Virtual": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Dispose", - "Parameters": [], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "System.IDisposable", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Validate", - "Parameters": [ - { - "Name": "entity", - "Type": "T0" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "TEntity", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "Validate", - "Parameters": [ - { - "Name": "entity", - "Type": "T0" - }, - { - "Name": "keyPrefix", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "TEntity", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Method", - "Name": "Dispose", - "Parameters": [ - { - "Name": "disposing", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Protected", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.BadRequestErrorMessageResult", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.ObjectResult", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "ExecuteResultAsync", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.ActionContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.IActionResult", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Message", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "message", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.ConflictResult", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.StatusCodeResult", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.ExceptionResult", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.ObjectResult", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "ExecuteResultAsync", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.ActionContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.IActionResult", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Exception", - "Parameters": [], - "ReturnType": "System.Exception", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IncludeErrorDetail", - "Parameters": [], - "ReturnType": "System.Boolean", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "exception", - "Type": "System.Exception" - }, - { - "Name": "includeErrorDetail", - "Type": "System.Boolean" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.HttpError", - "Visibility": "Public", - "Kind": "Class", - "Sealed": true, - "BaseType": "System.Collections.Generic.Dictionary", - "ImplementedInterfaces": [ - "System.Xml.Serialization.IXmlSerializable" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_Message", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Message", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ModelState", - "Parameters": [], - "ReturnType": "System.Web.Http.HttpError", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_MessageDetail", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_MessageDetail", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ExceptionMessage", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ExceptionMessage", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ExceptionType", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_ExceptionType", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_StackTrace", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_StackTrace", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_InnerException", - "Parameters": [], - "ReturnType": "System.Web.Http.HttpError", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetPropertyValue", - "Parameters": [ - { - "Name": "key", - "Type": "System.String" - } - ], - "ReturnType": "T0", - "Visibility": "Public", - "GenericParameter": [ - { - "ParameterName": "TValue", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "message", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "exception", - "Type": "System.Exception" - }, - { - "Name": "includeErrorDetail", - "Type": "System.Boolean" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelState", - "Type": "Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary" - }, - { - "Name": "includeErrorDetail", - "Type": "System.Boolean" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.HttpErrorKeys", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Field", - "Name": "MessageKey", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "MessageDetailKey", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "ModelStateKey", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "ExceptionMessageKey", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "ExceptionTypeKey", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "StackTraceKey", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "InnerExceptionKey", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "MessageLanguageKey", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "ErrorCodeKey", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.HttpResponseException", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "System.Exception", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Response", - "Parameters": [], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "response", - "Type": "System.Net.Http.HttpResponseMessage" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.InternalServerErrorResult", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.StatusCodeResult", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.InvalidModelStateResult", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.ObjectResult", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "ExecuteResultAsync", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.ActionContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.IActionResult", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_ModelState", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IncludeErrorDetail", - "Parameters": [], - "ReturnType": "System.Boolean", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "modelState", - "Type": "Microsoft.AspNetCore.Mvc.ModelBinding.ModelStateDictionary" - }, - { - "Name": "includeErrorDetail", - "Type": "System.Boolean" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.NegotiatedContentResult", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.ObjectResult", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "ExecuteResultAsync", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.ActionContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Virtual": true, - "Override": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.IActionResult", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Content", - "Parameters": [], - "ReturnType": "T0", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "statusCode", - "Type": "System.Net.HttpStatusCode" - }, - { - "Name": "content", - "Type": "T0" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [ - { - "ParameterName": "T", - "ParameterPosition": 0, - "BaseTypeOrInterfaces": [] - } - ] - }, - { - "Name": "System.Web.Http.FromUriAttribute", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "System.Attribute", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.ModelBinding.IOptionalBinderMetadata", - "Microsoft.AspNetCore.Mvc.ModelBinding.IBindingSourceMetadata", - "Microsoft.AspNetCore.Mvc.ModelBinding.IModelNameProvider" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_BindingSource", - "Parameters": [], - "ReturnType": "Microsoft.AspNetCore.Mvc.ModelBinding.BindingSource", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ModelBinding.IBindingSourceMetadata", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_IsOptional", - "Parameters": [], - "ReturnType": "System.Boolean", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ModelBinding.IOptionalBinderMetadata", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_IsOptional", - "Parameters": [ - { - "Name": "value", - "Type": "System.Boolean" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Name", - "Parameters": [], - "ReturnType": "System.String", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ModelBinding.IModelNameProvider", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Name", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Web.Http.ResponseMessageResult", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "Microsoft.AspNetCore.Mvc.ObjectResult", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Response", - "Parameters": [], - "ReturnType": "System.Net.Http.HttpResponseMessage", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "response", - "Type": "System.Net.Http.HttpResponseMessage" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Builder.WebApiCompatShimRouteBuilderExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "MapWebApiRoute", - "Parameters": [ - { - "Name": "routeCollectionBuilder", - "Type": "Microsoft.AspNetCore.Routing.IRouteBuilder" - }, - { - "Name": "name", - "Type": "System.String" - }, - { - "Name": "template", - "Type": "System.String" - } - ], - "ReturnType": "Microsoft.AspNetCore.Routing.IRouteBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MapWebApiRoute", - "Parameters": [ - { - "Name": "routeCollectionBuilder", - "Type": "Microsoft.AspNetCore.Routing.IRouteBuilder" - }, - { - "Name": "name", - "Type": "System.String" - }, - { - "Name": "template", - "Type": "System.String" - }, - { - "Name": "defaults", - "Type": "System.Object" - } - ], - "ReturnType": "Microsoft.AspNetCore.Routing.IRouteBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MapWebApiRoute", - "Parameters": [ - { - "Name": "routeCollectionBuilder", - "Type": "Microsoft.AspNetCore.Routing.IRouteBuilder" - }, - { - "Name": "name", - "Type": "System.String" - }, - { - "Name": "template", - "Type": "System.String" - }, - { - "Name": "defaults", - "Type": "System.Object" - }, - { - "Name": "constraints", - "Type": "System.Object" - } - ], - "ReturnType": "Microsoft.AspNetCore.Routing.IRouteBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MapWebApiRoute", - "Parameters": [ - { - "Name": "routeCollectionBuilder", - "Type": "Microsoft.AspNetCore.Routing.IRouteBuilder" - }, - { - "Name": "name", - "Type": "System.String" - }, - { - "Name": "template", - "Type": "System.String" - }, - { - "Name": "defaults", - "Type": "System.Object" - }, - { - "Name": "constraints", - "Type": "System.Object" - }, - { - "Name": "dataTokens", - "Type": "System.Object" - } - ], - "ReturnType": "Microsoft.AspNetCore.Routing.IRouteBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.ModelBinding.IOptionalBinderMetadata", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_IsOptional", - "Parameters": [], - "ReturnType": "System.Boolean", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IUseWebApiActionConventions", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IUseWebApiOverloading", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IUseWebApiParameterConventions", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IUseWebApiRoutes", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.UseWebApiActionConventionsAttribute", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "System.Attribute", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IUseWebApiActionConventions" - ], - "Members": [ - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.UseWebApiOverloadingAttribute", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "System.Attribute", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IUseWebApiOverloading" - ], - "Members": [ - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.UseWebApiParameterConventionsAttribute", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "System.Attribute", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IUseWebApiParameterConventions" - ], - "Members": [ - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.UseWebApiRoutesAttribute", - "Visibility": "Public", - "Kind": "Class", - "BaseType": "System.Attribute", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IUseWebApiRoutes" - ], - "Members": [ - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.WebApiActionConventionsApplicationModelConvention", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.ApplicationModels.IControllerModelConvention" - ], - "Members": [ - { - "Kind": "Method", - "Name": "Apply", - "Parameters": [ - { - "Name": "controller", - "Type": "Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerModel" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ApplicationModels.IControllerModelConvention", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.WebApiOverloadingApplicationModelConvention", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.ApplicationModels.IActionModelConvention" - ], - "Members": [ - { - "Kind": "Method", - "Name": "Apply", - "Parameters": [ - { - "Name": "action", - "Type": "Microsoft.AspNetCore.Mvc.ApplicationModels.ActionModel" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ApplicationModels.IActionModelConvention", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.WebApiParameterConventionsApplicationModelConvention", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.ApplicationModels.IActionModelConvention" - ], - "Members": [ - { - "Kind": "Method", - "Name": "Apply", - "Parameters": [ - { - "Name": "action", - "Type": "Microsoft.AspNetCore.Mvc.ApplicationModels.ActionModel" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ApplicationModels.IActionModelConvention", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.WebApiRoutesApplicationModelConvention", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.ApplicationModels.IControllerModelConvention" - ], - "Members": [ - { - "Kind": "Method", - "Name": "Apply", - "Parameters": [ - { - "Name": "controller", - "Type": "Microsoft.AspNetCore.Mvc.ApplicationModels.ControllerModel" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ApplicationModels.IControllerModelConvention", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "area", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.HttpResponseMessageOutputFormatter", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter" - ], - "Members": [ - { - "Kind": "Method", - "Name": "CanWriteResult", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterCanWriteContext" - } - ], - "ReturnType": "System.Boolean", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "WriteAsync", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.Formatters.OutputFormatterWriteContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Formatters.IOutputFormatter", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.FormDataCollectionExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "NormalizeJQueryToMvc", - "Parameters": [ - { - "Name": "key", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Static": true, - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetJQueryNameValuePairs", - "Parameters": [ - { - "Name": "formData", - "Type": "System.Net.Http.Formatting.FormDataCollection" - } - ], - "ReturnType": "System.Collections.Generic.IEnumerable>", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.HttpRequestMessageFeature", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IHttpRequestMessageFeature" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_HttpRequestMessage", - "Parameters": [], - "ReturnType": "System.Net.Http.HttpRequestMessage", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IHttpRequestMessageFeature", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_HttpRequestMessage", - "Parameters": [ - { - "Name": "value", - "Type": "System.Net.Http.HttpRequestMessage" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IHttpRequestMessageFeature", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "httpContext", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.HttpRequestMessageHttpContextExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "GetHttpRequestMessage", - "Parameters": [ - { - "Name": "httpContext", - "Type": "Microsoft.AspNetCore.Http.HttpContext" - } - ], - "ReturnType": "System.Net.Http.HttpRequestMessage", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.HttpRequestMessageModelBinder", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder" - ], - "Members": [ - { - "Kind": "Method", - "Name": "BindModelAsync", - "Parameters": [ - { - "Name": "bindingContext", - "Type": "Microsoft.AspNetCore.Mvc.ModelBinding.ModelBindingContext" - } - ], - "ReturnType": "System.Threading.Tasks.Task", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.HttpRequestMessageModelBinderProvider", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinderProvider" - ], - "Members": [ - { - "Kind": "Method", - "Name": "GetBinder", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.ModelBinding.ModelBinderProviderContext" - } - ], - "ReturnType": "Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinder", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ModelBinding.IModelBinderProvider", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.IHttpRequestMessageFeature", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_HttpRequestMessage", - "Parameters": [], - "ReturnType": "System.Net.Http.HttpRequestMessage", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_HttpRequestMessage", - "Parameters": [ - { - "Name": "value", - "Type": "System.Net.Http.HttpRequestMessage" - } - ], - "ReturnType": "System.Void", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.HttpResponseExceptionActionFilter", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.Filters.IActionFilter", - "Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_Order", - "Parameters": [], - "ReturnType": "System.Int32", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Filters.IOrderedFilter", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Order", - "Parameters": [ - { - "Name": "value", - "Type": "System.Int32" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "OnActionExecuting", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.Filters.ActionExecutingContext" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Filters.IActionFilter", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "OnActionExecuted", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.Filters.ActionExecutedContext" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.Filters.IActionFilter", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.OverloadActionConstraint", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraint" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_Order", - "Parameters": [], - "ReturnType": "System.Int32", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraint", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Accept", - "Parameters": [ - { - "Name": "context", - "Type": "Microsoft.AspNetCore.Mvc.ActionConstraints.ActionConstraintContext" - } - ], - "ReturnType": "System.Boolean", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.AspNetCore.Mvc.ActionConstraints.IActionConstraint", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.WebApiCompatShimOptions", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Formatters", - "Parameters": [], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatterCollection", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Formatters", - "Parameters": [ - { - "Name": "value", - "Type": "System.Net.Http.Formatting.MediaTypeFormatterCollection" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.WebApiCompatShimOptionsSetup", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "Microsoft.Extensions.Options.IConfigureOptions", - "Microsoft.Extensions.Options.IConfigureOptions" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_Name", - "Parameters": [], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Name", - "Parameters": [ - { - "Name": "value", - "Type": "System.String" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Configure", - "Parameters": [ - { - "Name": "options", - "Type": "Microsoft.AspNetCore.Mvc.MvcOptions" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.Extensions.Options.IConfigureOptions", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Configure", - "Parameters": [ - { - "Name": "options", - "Type": "Microsoft.AspNetCore.Mvc.WebApiCompatShim.WebApiCompatShimOptions" - } - ], - "ReturnType": "System.Void", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "Microsoft.Extensions.Options.IConfigureOptions", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Field", - "Name": "DefaultAreaName", - "Parameters": [], - "ReturnType": "System.String", - "Static": true, - "ReadOnly": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "Microsoft.Extensions.DependencyInjection.WebApiCompatShimMvcBuilderExtensions", - "Visibility": "Public", - "Kind": "Class", - "Abstract": true, - "Static": true, - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "AddWebApiConventions", - "Parameters": [ - { - "Name": "builder", - "Type": "Microsoft.Extensions.DependencyInjection.IMvcBuilder" - } - ], - "ReturnType": "Microsoft.Extensions.DependencyInjection.IMvcBuilder", - "Static": true, - "Extension": true, - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Net.Http.Formatting.ContentNegotiationResult", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Formatter", - "Parameters": [], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatter", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_Formatter", - "Parameters": [ - { - "Name": "value", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_MediaType", - "Parameters": [], - "ReturnType": "System.Net.Http.Headers.MediaTypeHeaderValue", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "set_MediaType", - "Parameters": [ - { - "Name": "value", - "Type": "System.Net.Http.Headers.MediaTypeHeaderValue" - } - ], - "ReturnType": "System.Void", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - }, - { - "Name": "mediaType", - "Type": "System.Net.Http.Headers.MediaTypeHeaderValue" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Net.Http.Formatting.DefaultContentNegotiator", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "System.Net.Http.Formatting.IContentNegotiator" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_ExcludeMatchOnTypeOnly", - "Parameters": [], - "ReturnType": "System.Boolean", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Negotiate", - "Parameters": [ - { - "Name": "type", - "Type": "System.Type" - }, - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "formatters", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "ReturnType": "System.Net.Http.Formatting.ContentNegotiationResult", - "Virtual": true, - "ImplementedInterface": "System.Net.Http.Formatting.IContentNegotiator", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ComputeFormatterMatches", - "Parameters": [ - { - "Name": "type", - "Type": "System.Type" - }, - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "formatters", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "ReturnType": "System.Collections.ObjectModel.Collection", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "SelectResponseMediaTypeFormatter", - "Parameters": [ - { - "Name": "matches", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatterMatch", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "SelectResponseCharacterEncoding", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - } - ], - "ReturnType": "System.Text.Encoding", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MatchMediaTypeMapping", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - } - ], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatterMatch", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MatchAcceptHeader", - "Parameters": [ - { - "Name": "sortedAcceptValues", - "Type": "System.Collections.Generic.IEnumerable" - }, - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - } - ], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatterMatch", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MatchRequestMediaType", - "Parameters": [ - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - } - ], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatterMatch", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ShouldMatchOnType", - "Parameters": [ - { - "Name": "sortedAcceptValues", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "ReturnType": "System.Boolean", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "MatchType", - "Parameters": [ - { - "Name": "type", - "Type": "System.Type" - }, - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - } - ], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatterMatch", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "SortMediaTypeWithQualityHeaderValuesByQFactor", - "Parameters": [ - { - "Name": "headerValues", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "SortStringWithQualityHeaderValuesByQFactor", - "Parameters": [ - { - "Name": "headerValues", - "Type": "System.Collections.Generic.ICollection" - } - ], - "ReturnType": "System.Collections.Generic.IEnumerable", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "UpdateBestMatch", - "Parameters": [ - { - "Name": "current", - "Type": "System.Net.Http.Formatting.MediaTypeFormatterMatch" - }, - { - "Name": "potentialReplacement", - "Type": "System.Net.Http.Formatting.MediaTypeFormatterMatch" - } - ], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatterMatch", - "Virtual": true, - "Visibility": "Protected", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "excludeMatchOnTypeOnly", - "Type": "System.Boolean" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Net.Http.Formatting.FormDataCollection", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [ - "System.Collections.Generic.IEnumerable>" - ], - "Members": [ - { - "Kind": "Method", - "Name": "get_Item", - "Parameters": [ - { - "Name": "name", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "ReadAsNameValueCollection", - "Parameters": [], - "ReturnType": "System.Collections.Specialized.NameValueCollection", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "Get", - "Parameters": [ - { - "Name": "key", - "Type": "System.String" - } - ], - "ReturnType": "System.String", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetValues", - "Parameters": [ - { - "Name": "key", - "Type": "System.String" - } - ], - "ReturnType": "System.String[]", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "GetEnumerator", - "Parameters": [], - "ReturnType": "System.Collections.Generic.IEnumerator>", - "Sealed": true, - "Virtual": true, - "ImplementedInterface": "System.Collections.Generic.IEnumerable>", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "pairs", - "Type": "System.Collections.Generic.IEnumerable>" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "uri", - "Type": "System.Uri" - } - ], - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "query", - "Type": "System.String" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Net.Http.Formatting.IContentNegotiator", - "Visibility": "Public", - "Kind": "Interface", - "Abstract": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "Negotiate", - "Parameters": [ - { - "Name": "type", - "Type": "System.Type" - }, - { - "Name": "request", - "Type": "System.Net.Http.HttpRequestMessage" - }, - { - "Name": "formatters", - "Type": "System.Collections.Generic.IEnumerable" - } - ], - "ReturnType": "System.Net.Http.Formatting.ContentNegotiationResult", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Net.Http.Formatting.MediaTypeFormatterMatch", - "Visibility": "Public", - "Kind": "Class", - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Method", - "Name": "get_Formatter", - "Parameters": [], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatter", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_MediaType", - "Parameters": [], - "ReturnType": "System.Net.Http.Headers.MediaTypeHeaderValue", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Quality", - "Parameters": [], - "ReturnType": "System.Double", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Method", - "Name": "get_Ranking", - "Parameters": [], - "ReturnType": "System.Net.Http.Formatting.MediaTypeFormatterMatchRanking", - "Visibility": "Public", - "GenericParameter": [] - }, - { - "Kind": "Constructor", - "Name": ".ctor", - "Parameters": [ - { - "Name": "formatter", - "Type": "System.Net.Http.Formatting.MediaTypeFormatter" - }, - { - "Name": "mediaType", - "Type": "System.Net.Http.Headers.MediaTypeHeaderValue" - }, - { - "Name": "quality", - "Type": "System.Nullable" - }, - { - "Name": "ranking", - "Type": "System.Net.Http.Formatting.MediaTypeFormatterMatchRanking" - } - ], - "Visibility": "Public", - "GenericParameter": [] - } - ], - "GenericParameters": [] - }, - { - "Name": "System.Net.Http.Formatting.MediaTypeFormatterMatchRanking", - "Visibility": "Public", - "Kind": "Enumeration", - "Sealed": true, - "ImplementedInterfaces": [], - "Members": [ - { - "Kind": "Field", - "Name": "None", - "Parameters": [], - "GenericParameter": [], - "Literal": "0" - }, - { - "Kind": "Field", - "Name": "MatchOnCanWriteType", - "Parameters": [], - "GenericParameter": [], - "Literal": "1" - }, - { - "Kind": "Field", - "Name": "MatchOnRequestAcceptHeaderLiteral", - "Parameters": [], - "GenericParameter": [], - "Literal": "2" - }, - { - "Kind": "Field", - "Name": "MatchOnRequestAcceptHeaderSubtypeMediaRange", - "Parameters": [], - "GenericParameter": [], - "Literal": "3" - }, - { - "Kind": "Field", - "Name": "MatchOnRequestAcceptHeaderAllMediaRange", - "Parameters": [], - "GenericParameter": [], - "Literal": "4" - }, - { - "Kind": "Field", - "Name": "MatchOnRequestWithMediaTypeMapping", - "Parameters": [], - "GenericParameter": [], - "Literal": "5" - }, - { - "Kind": "Field", - "Name": "MatchOnRequestMediaType", - "Parameters": [], - "GenericParameter": [], - "Literal": "6" - } - ], - "GenericParameters": [] - } - ] -} \ No newline at end of file diff --git a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj index d93286ee67..50011f6b41 100644 --- a/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj +++ b/test/Microsoft.AspNetCore.Mvc.FunctionalTests/Microsoft.AspNetCore.Mvc.FunctionalTests.csproj @@ -47,10 +47,10 @@ - +