Removed System.Web.Http.Common
This commit is contained in:
Родитель
7c9ce820a9
Коммит
387212fd63
46
Runtime.sln
46
Runtime.sln
|
@ -67,12 +67,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Json.Test.Integratio
|
|||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Net.Http.Formatting.Test.Integration", "test\System.Net.Http.Formatting.Test.Integration\System.Net.Http.Formatting.Test.Integration.csproj", "{6C18CC83-1E4C-42D2-B93E-55D6C363850C}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.Common", "src\System.Web.Http.Common\System.Web.Http.Common.csproj", "{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.SelfHost", "src\System.Web.Http.SelfHost\System.Web.Http.SelfHost.csproj", "{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.Common.Test", "test\System.Web.Http.Common.Test\System.Web.Http.Common.Test.csproj", "{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "System.Web.Http.WebHost", "src\System.Web.Http.WebHost\System.Web.Http.WebHost.csproj", "{A0187BC2-8325-4BB2-8697-7F955CF4173E}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.Web.Http.Data", "src\Microsoft.Web.Http.Data\Microsoft.Web.Http.Data.csproj", "{ACE91549-D86E-4EB6-8C2A-5FF51386BB68}"
|
||||
|
@ -736,26 +732,6 @@ Global
|
|||
{6C18CC83-1E4C-42D2-B93E-55D6C363850C}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{6C18CC83-1E4C-42D2-B93E-55D6C363850C}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{6C18CC83-1E4C-42D2-B93E-55D6C363850C}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCov|Any CPU.ActiveCfg = CodeCoverage|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCov|Any CPU.Build.0 = CodeCoverage|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCov|Mixed Platforms.ActiveCfg = CodeCoverage|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCov|Mixed Platforms.Build.0 = CodeCoverage|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCov|x86.ActiveCfg = CodeCoverage|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCoverage|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCoverage|Any CPU.Build.0 = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCoverage|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCoverage|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.CodeCoverage|x86.ActiveCfg = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.CodeCov|Any CPU.ActiveCfg = CodeCoverage|Any CPU
|
||||
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.CodeCov|Any CPU.Build.0 = CodeCoverage|Any CPU
|
||||
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.CodeCov|Mixed Platforms.ActiveCfg = CodeCoverage|Any CPU
|
||||
|
@ -776,26 +752,6 @@ Global
|
|||
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCov|Any CPU.ActiveCfg = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCov|Any CPU.Build.0 = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCov|Mixed Platforms.ActiveCfg = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCov|Mixed Platforms.Build.0 = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCov|x86.ActiveCfg = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCoverage|Any CPU.ActiveCfg = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCoverage|Any CPU.Build.0 = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCoverage|Mixed Platforms.ActiveCfg = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCoverage|Mixed Platforms.Build.0 = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.CodeCoverage|x86.ActiveCfg = CodeCoverage|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Debug|x86.ActiveCfg = Debug|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Release|Mixed Platforms.Build.0 = Release|Any CPU
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478}.Release|x86.ActiveCfg = Release|Any CPU
|
||||
{A0187BC2-8325-4BB2-8697-7F955CF4173E}.CodeCov|Any CPU.ActiveCfg = CodeCoverage|Any CPU
|
||||
{A0187BC2-8325-4BB2-8697-7F955CF4173E}.CodeCov|Any CPU.Build.0 = CodeCoverage|Any CPU
|
||||
{A0187BC2-8325-4BB2-8697-7F955CF4173E}.CodeCov|Mixed Platforms.ActiveCfg = CodeCoverage|Any CPU
|
||||
|
@ -1055,7 +1011,6 @@ Global
|
|||
{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
|
||||
{F0441BE9-BDC0-4629-BE5A-8765FFAA2481} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
|
||||
{668E9021-CE84-49D9-98FB-DF125A9FCDB0} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
|
||||
{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
|
||||
{66492E69-CE4C-4FB1-9B1F-88DEE09D06F1} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
|
||||
{A0187BC2-8325-4BB2-8697-7F955CF4173E} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
|
||||
{ACE91549-D86E-4EB6-8C2A-5FF51386BB68} = {A9836F9E-6DB3-4D9F-ADCA-CF42D8C8BA93}
|
||||
|
@ -1080,7 +1035,6 @@ Global
|
|||
{7AF77741-9158-4D5F-8782-8F21FADF025F} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
|
||||
{A7B1264E-BCE5-42A8-8B5E-001A5360B128} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
|
||||
{6C18CC83-1E4C-42D2-B93E-55D6C363850C} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
|
||||
{7FB5C0C0-5223-4C79-A8DA-D2A0F264A478} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
|
||||
{81876811-6C36-492A-9609-F0E85990FBC9} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
|
||||
{3267DFC6-B34D-4011-BC0F-D3B56AF6F608} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
|
||||
{EA62944F-BD25-4730-9405-9BE8FF5BEACD} = {C40883CD-366D-4534-8B58-3EA0D13136DF}
|
||||
|
|
|
@ -8,8 +8,9 @@
|
|||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace System.Web.Http.Common.Properties {
|
||||
namespace System.Web.Http.Properties {
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
|
||||
/// <summary>
|
||||
|
@ -22,14 +23,14 @@ namespace System.Web.Http.Common.Properties {
|
|||
[global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")]
|
||||
[global::System.Diagnostics.DebuggerNonUserCodeAttribute()]
|
||||
[global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
|
||||
internal class SRResources {
|
||||
internal class CommonWebApiResources {
|
||||
|
||||
private static global::System.Resources.ResourceManager resourceMan;
|
||||
|
||||
private static global::System.Globalization.CultureInfo resourceCulture;
|
||||
|
||||
[global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")]
|
||||
internal SRResources() {
|
||||
internal CommonWebApiResources() {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -39,7 +40,14 @@ namespace System.Web.Http.Common.Properties {
|
|||
internal static global::System.Resources.ResourceManager ResourceManager {
|
||||
get {
|
||||
if (object.ReferenceEquals(resourceMan, null)) {
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("System.Web.Http.Common.Properties.SRResources", typeof(SRResources).Assembly);
|
||||
// Find the CommonResources.resources file's full resource name in this assembly
|
||||
string commonResourcesName = global::System.Reflection.Assembly.GetExecutingAssembly().GetManifestResourceNames().Where(s => s.EndsWith("CommonWebApiResources.resources", StringComparison.OrdinalIgnoreCase)).Single();
|
||||
|
||||
// Trim off the ".resources"
|
||||
commonResourcesName = commonResourcesName.Substring(0, commonResourcesName.Length - 10);
|
||||
|
||||
// Load the resource manager
|
||||
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager(commonResourcesName, typeof(CommonWebApiResources).Assembly);
|
||||
resourceMan = temp;
|
||||
}
|
||||
return resourceMan;
|
|
@ -1,4 +1,4 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
<!--
|
||||
Microsoft ResX Schema
|
|
@ -2,15 +2,15 @@ using System.Collections.Generic;
|
|||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Globalization;
|
||||
using System.Web.Http.Common.Properties;
|
||||
using System.Web.Http.Properties;
|
||||
|
||||
namespace System.Web.Http.Common
|
||||
namespace System.Web.Http
|
||||
{
|
||||
/// <summary>
|
||||
/// Utility class for creating and unwrapping <see cref="Exception"/> instances.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1716:IdentifiersShouldNotMatchKeywords", MessageId = "Error", Justification = "This usage is okay.")]
|
||||
public static class Error
|
||||
internal static class Error
|
||||
{
|
||||
/// <summary>
|
||||
/// Formats the specified resource string using <see cref="M:CultureInfo.CurrentCulture"/>.
|
||||
|
@ -19,7 +19,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="args">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The formatted string.</returns>
|
||||
[SuppressMessage("Microsoft.Naming", "CA1719:ParameterNamesShouldNotMatchMemberNames", MessageId = "0#", Justification = "Standard String.Format pattern and names.")]
|
||||
public static string Format(string format, params object[] args)
|
||||
internal static string Format(string format, params object[] args)
|
||||
{
|
||||
return String.Format(CultureInfo.CurrentCulture, format, args);
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentException Argument(string messageFormat, params object[] messageArgs)
|
||||
internal static ArgumentException Argument(string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
return new ArgumentException(Error.Format(messageFormat, messageArgs));
|
||||
}
|
||||
|
@ -42,7 +42,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentException Argument(string parameterName, string messageFormat, params object[] messageArgs)
|
||||
internal static ArgumentException Argument(string parameterName, string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
return new ArgumentException(Error.Format(messageFormat, messageArgs), parameterName);
|
||||
}
|
||||
|
@ -53,9 +53,9 @@ namespace System.Web.Http.Common
|
|||
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
|
||||
/// <param name="actualValue">The value of the argument that causes this exception.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentException ArgumentUriNotHttpOrHttpsScheme(string parameterName, Uri actualValue)
|
||||
internal static ArgumentException ArgumentUriNotHttpOrHttpsScheme(string parameterName, Uri actualValue)
|
||||
{
|
||||
return new ArgumentException(Error.Format(SRResources.ArgumentInvalidHttpUriScheme, actualValue, Uri.UriSchemeHttp, Uri.UriSchemeHttps), parameterName);
|
||||
return new ArgumentException(Error.Format(CommonWebApiResources.ArgumentInvalidHttpUriScheme, actualValue, Uri.UriSchemeHttp, Uri.UriSchemeHttps), parameterName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -64,9 +64,9 @@ namespace System.Web.Http.Common
|
|||
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
|
||||
/// <param name="actualValue">The value of the argument that causes this exception.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentException ArgumentUriNotAbsolute(string parameterName, Uri actualValue)
|
||||
internal static ArgumentException ArgumentUriNotAbsolute(string parameterName, Uri actualValue)
|
||||
{
|
||||
return new ArgumentException(Error.Format(SRResources.ArgumentInvalidAbsoluteUri, actualValue), parameterName);
|
||||
return new ArgumentException(Error.Format(CommonWebApiResources.ArgumentInvalidAbsoluteUri, actualValue), parameterName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -76,9 +76,9 @@ namespace System.Web.Http.Common
|
|||
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
|
||||
/// <param name="actualValue">The value of the argument that causes this exception.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentException ArgumentUriHasQueryOrFragment(string parameterName, Uri actualValue)
|
||||
internal static ArgumentException ArgumentUriHasQueryOrFragment(string parameterName, Uri actualValue)
|
||||
{
|
||||
return new ArgumentException(Error.Format(SRResources.ArgumentUriHasQueryOrFragment, actualValue), parameterName);
|
||||
return new ArgumentException(Error.Format(CommonWebApiResources.ArgumentUriHasQueryOrFragment, actualValue), parameterName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -86,7 +86,7 @@ namespace System.Web.Http.Common
|
|||
/// </summary>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
[SuppressMessage("Microsoft.Usage", "CA2208:InstantiateArgumentExceptionsCorrectly", Justification = "The purpose of this API is to return an error for properties")]
|
||||
public static ArgumentNullException PropertyNull()
|
||||
internal static ArgumentNullException PropertyNull()
|
||||
{
|
||||
return new ArgumentNullException("value");
|
||||
}
|
||||
|
@ -96,7 +96,7 @@ namespace System.Web.Http.Common
|
|||
/// </summary>
|
||||
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentNullException ArgumentNull(string parameterName)
|
||||
internal static ArgumentNullException ArgumentNull(string parameterName)
|
||||
{
|
||||
return new ArgumentNullException(parameterName);
|
||||
}
|
||||
|
@ -108,7 +108,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentNullException ArgumentNull(string parameterName, string messageFormat, params object[] messageArgs)
|
||||
internal static ArgumentNullException ArgumentNull(string parameterName, string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
return new ArgumentNullException(parameterName, Error.Format(messageFormat, messageArgs));
|
||||
}
|
||||
|
@ -118,9 +118,9 @@ namespace System.Web.Http.Common
|
|||
/// </summary>
|
||||
/// <param name="parameterName">The name of the parameter that caused the current exception.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentException ArgumentNullOrEmpty(string parameterName)
|
||||
internal static ArgumentException ArgumentNullOrEmpty(string parameterName)
|
||||
{
|
||||
return Error.Argument(parameterName, SRResources.ArgumentNullOrEmpty, parameterName);
|
||||
return Error.Argument(parameterName, CommonWebApiResources.ArgumentNullOrEmpty, parameterName);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -131,7 +131,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentOutOfRangeException ArgumentOutOfRange(string parameterName, object actualValue, string messageFormat, params object[] messageArgs)
|
||||
internal static ArgumentOutOfRangeException ArgumentOutOfRange(string parameterName, object actualValue, string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
return new ArgumentOutOfRangeException(parameterName, actualValue, Error.Format(messageFormat, messageArgs));
|
||||
}
|
||||
|
@ -143,9 +143,9 @@ namespace System.Web.Http.Common
|
|||
/// <param name="actualValue">The value of the argument that causes this exception.</param>
|
||||
/// <param name="minValue">The minimum size of the argument.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentOutOfRangeException ArgumentGreaterThanOrEqualTo(string parameterName, object actualValue, object minValue)
|
||||
internal static ArgumentOutOfRangeException ArgumentGreaterThanOrEqualTo(string parameterName, object actualValue, object minValue)
|
||||
{
|
||||
return new ArgumentOutOfRangeException(parameterName, actualValue, Error.Format(SRResources.ArgumentMustBeGreaterThanOrEqualTo, minValue));
|
||||
return new ArgumentOutOfRangeException(parameterName, actualValue, Error.Format(CommonWebApiResources.ArgumentMustBeGreaterThanOrEqualTo, minValue));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -155,16 +155,16 @@ namespace System.Web.Http.Common
|
|||
/// <param name="actualValue">The value of the argument that causes this exception.</param>
|
||||
/// <param name="maxValue">The maximum size of the argument.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ArgumentOutOfRangeException ArgumentMustBeLessThanOrEqualTo(string parameterName, object actualValue, object maxValue)
|
||||
internal static ArgumentOutOfRangeException ArgumentMustBeLessThanOrEqualTo(string parameterName, object actualValue, object maxValue)
|
||||
{
|
||||
return new ArgumentOutOfRangeException(parameterName, actualValue, Error.Format(SRResources.ArgumentMustBeLessThanOrEqualTo, maxValue));
|
||||
return new ArgumentOutOfRangeException(parameterName, actualValue, Error.Format(CommonWebApiResources.ArgumentMustBeLessThanOrEqualTo, maxValue));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Creates an <see cref="KeyNotFoundException"/> with a message saying that the key was not found.
|
||||
/// </summary>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static KeyNotFoundException KeyNotFound()
|
||||
internal static KeyNotFoundException KeyNotFound()
|
||||
{
|
||||
return new KeyNotFoundException();
|
||||
}
|
||||
|
@ -175,7 +175,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static KeyNotFoundException KeyNotFound(string messageFormat, params object[] messageArgs)
|
||||
internal static KeyNotFoundException KeyNotFound(string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
return new KeyNotFoundException(Error.Format(messageFormat, messageArgs));
|
||||
}
|
||||
|
@ -186,7 +186,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static ObjectDisposedException ObjectDisposed(string messageFormat, params object[] messageArgs)
|
||||
internal static ObjectDisposedException ObjectDisposed(string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
// Pass in null, not disposedObject.GetType().FullName as per the above guideline
|
||||
return new ObjectDisposedException(null, Error.Format(messageFormat, messageArgs));
|
||||
|
@ -196,7 +196,7 @@ namespace System.Web.Http.Common
|
|||
/// Creates an <see cref="OperationCanceledException"/> initialized with the provided parameters.
|
||||
/// </summary>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static OperationCanceledException OperationCanceled()
|
||||
internal static OperationCanceledException OperationCanceled()
|
||||
{
|
||||
return new OperationCanceledException();
|
||||
}
|
||||
|
@ -207,7 +207,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static OperationCanceledException OperationCanceled(string messageFormat, params object[] messageArgs)
|
||||
internal static OperationCanceledException OperationCanceled(string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
return new OperationCanceledException(Error.Format(messageFormat, messageArgs));
|
||||
}
|
||||
|
@ -219,7 +219,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="invalidValue">The value of the argument that failed.</param>
|
||||
/// <param name="enumClass">A <see cref="Type"/> that represents the enumeration class with the valid values.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static InvalidEnumArgumentException InvalidEnumArgument(string parameterName, int invalidValue, Type enumClass)
|
||||
internal static InvalidEnumArgumentException InvalidEnumArgument(string parameterName, int invalidValue, Type enumClass)
|
||||
{
|
||||
return new InvalidEnumArgumentException(parameterName, invalidValue, enumClass);
|
||||
}
|
||||
|
@ -230,7 +230,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static InvalidOperationException InvalidOperation(string messageFormat, params object[] messageArgs)
|
||||
internal static InvalidOperationException InvalidOperation(string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
return new InvalidOperationException(Error.Format(messageFormat, messageArgs));
|
||||
}
|
||||
|
@ -242,7 +242,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static InvalidOperationException InvalidOperation(Exception innerException, string messageFormat, params object[] messageArgs)
|
||||
internal static InvalidOperationException InvalidOperation(Exception innerException, string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
return new InvalidOperationException(Error.Format(messageFormat, messageArgs), innerException);
|
||||
}
|
||||
|
@ -253,7 +253,7 @@ namespace System.Web.Http.Common
|
|||
/// <param name="messageFormat">A composite format string explaining the reason for the exception.</param>
|
||||
/// <param name="messageArgs">An object array that contains zero or more objects to format.</param>
|
||||
/// <returns>The logged <see cref="Exception"/>.</returns>
|
||||
public static NotSupportedException NotSupported(string messageFormat, params object[] messageArgs)
|
||||
internal static NotSupportedException NotSupported(string messageFormat, params object[] messageArgs)
|
||||
{
|
||||
return new NotSupportedException(Error.Format(messageFormat, messageArgs));
|
||||
}
|
|
@ -1,18 +1,18 @@
|
|||
using System.Net.Http;
|
||||
|
||||
namespace System.Web.Http.Common
|
||||
namespace System.Web.Http
|
||||
{
|
||||
/// <summary>
|
||||
/// Various helper methods for the static members of <see cref="HttpMethod"/>.
|
||||
/// </summary>
|
||||
public static class HttpMethodHelper
|
||||
internal static class HttpMethodHelper
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the static <see cref="HttpMethod"/> instance for any given HTTP method name.
|
||||
/// </summary>
|
||||
/// <param name="method">The HTTP request method.</param>
|
||||
/// <returns>An existing static <see cref="HttpMethod"/> or a new instance if the method was not found.</returns>
|
||||
public static HttpMethod GetHttpMethod(string method)
|
||||
internal static HttpMethod GetHttpMethod(string method)
|
||||
{
|
||||
if (String.IsNullOrEmpty(method))
|
||||
{
|
|
@ -3,7 +3,7 @@ using System.Data;
|
|||
using System.Data.Entity;
|
||||
using System.Data.Entity.Infrastructure;
|
||||
using System.Data.Objects;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.EntityFramework
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@ using System.Data.Entity;
|
|||
using System.Data.Entity.Infrastructure;
|
||||
using System.Data.Objects;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Controllers;
|
||||
using Microsoft.Web.Http.Data.EntityFramework.Metadata;
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Data.Entity;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
using Microsoft.Web.Http.Data.Metadata;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.EntityFramework.Metadata
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.Data.Objects;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
using Microsoft.Web.Http.Data.Metadata;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.EntityFramework.Metadata
|
||||
|
|
|
@ -4,7 +4,7 @@ using System.ComponentModel.DataAnnotations;
|
|||
using System.Data.Metadata.Edm;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.EntityFramework.Metadata
|
||||
{
|
||||
|
|
|
@ -6,7 +6,7 @@ using System.Data.Objects;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.EntityFramework.Metadata
|
||||
{
|
||||
|
|
|
@ -66,6 +66,9 @@
|
|||
<Compile Include="..\CommonAssemblyInfo.cs">
|
||||
<Link>Properties\CommonAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\Error.cs">
|
||||
<Link>Common\Error.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="DbContextExtensions.cs" />
|
||||
<Compile Include="DbDataController.cs" />
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
|
@ -100,10 +103,6 @@
|
|||
<Project>{668E9021-CE84-49D9-98FB-DF125A9FCDB0}</Project>
|
||||
<Name>System.Net.Http.Formatting</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\System.Web.Http.Common\System.Web.Http.Common.csproj">
|
||||
<Project>{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}</Project>
|
||||
<Name>System.Web.Http.Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Microsoft.Web.Http.Data\Microsoft.Web.Http.Data.csproj">
|
||||
<Project>{ACE91549-D86E-4EB6-8C2A-5FF51386BB68}</Project>
|
||||
<Name>Microsoft.Web.Http.Data</Name>
|
||||
|
@ -113,6 +112,21 @@
|
|||
<Name>System.Web.Http</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Common\CommonWebApiResources.Designer.cs">
|
||||
<Link>Properties\CommonWebApiResources.Designer.cs</Link>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>CommonWebApiResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\Common\CommonWebApiResources.resx">
|
||||
<Link>Properties\CommonWebApiResources.resx</Link>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>CommonWebApiResources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resource.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
using System.ComponentModel;
|
||||
using System.Data;
|
||||
using System.Data.Objects;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.EntityFramework
|
||||
{
|
||||
|
|
|
@ -5,7 +5,7 @@ using System.Data;
|
|||
using System.Data.Metadata.Edm;
|
||||
using System.Data.Objects;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.EntityFramework
|
||||
{
|
||||
|
|
|
@ -7,7 +7,7 @@ using System.ComponentModel.DataAnnotations;
|
|||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Controllers;
|
||||
|
||||
namespace Microsoft.Web.Http.Data
|
||||
|
|
|
@ -10,7 +10,6 @@ using System.Reflection;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
|
||||
namespace Microsoft.Web.Http.Data
|
||||
|
|
|
@ -7,7 +7,6 @@ using System.ComponentModel.DataAnnotations;
|
|||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Filters;
|
||||
using Microsoft.Web.Http.Data.Metadata;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.ComponentModel.DataAnnotations;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.Metadata
|
||||
{
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.Metadata
|
||||
{
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
using System;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Microsoft.Web.Http.Data.Metadata
|
||||
{
|
||||
|
|
|
@ -68,11 +68,14 @@
|
|||
<Compile Include="..\CommonAssemblyInfo.cs">
|
||||
<Link>Properties\CommonAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\System.Web.Http.Common\TaskHelpers.cs">
|
||||
<Link>TaskUtility\TaskHelpers.cs</Link>
|
||||
<Compile Include="..\Common\Error.cs">
|
||||
<Link>Common\Error.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\System.Web.Http.Common\TaskHelpersExtensions.cs">
|
||||
<Link>TaskUtility\TaskHelpersExtensions.cs</Link>
|
||||
<Compile Include="..\Common\TaskHelpers.cs">
|
||||
<Link>Common\TaskHelpers.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\TaskHelpersExtensions.cs">
|
||||
<Link>Common\TaskHelpersExtensions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="ChangeOperation.cs" />
|
||||
<Compile Include="ChangeSet.cs" />
|
||||
|
@ -113,10 +116,6 @@
|
|||
<Project>{668E9021-CE84-49D9-98FB-DF125A9FCDB0}</Project>
|
||||
<Name>System.Net.Http.Formatting</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\System.Web.Http.Common\System.Web.Http.Common.csproj">
|
||||
<Project>{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}</Project>
|
||||
<Name>System.Web.Http.Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\System.Web.Http\System.Web.Http.csproj">
|
||||
<Project>{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440}</Project>
|
||||
<Name>System.Web.Http</Name>
|
||||
|
@ -125,6 +124,21 @@
|
|||
<ItemGroup>
|
||||
<CodeAnalysisDictionary Include="..\CodeAnalysisDictionary.xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Common\CommonWebApiResources.Designer.cs">
|
||||
<Link>Properties\CommonWebApiResources.Designer.cs</Link>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>CommonWebApiResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\Common\CommonWebApiResources.resx">
|
||||
<Link>Properties\CommonWebApiResources.resx</Link>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>CommonWebApiResources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resource.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.Linq.Expressions;
|
|||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Web.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Filters;
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Runtime.Serialization;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace Microsoft.Web.Http.Data
|
||||
{
|
||||
|
|
|
@ -3,7 +3,6 @@ using System.Diagnostics.CodeAnalysis;
|
|||
using System.Diagnostics.Contracts;
|
||||
using System.IO;
|
||||
using System.Net.Http.Headers;
|
||||
using System.Net.Http.Internal;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
|
@ -260,7 +259,7 @@ namespace System.Net.Http
|
|||
// exceptions so that the task finalizer doesn't tear down our app domain.
|
||||
if (_streamTask != null && _streamTask.IsValueCreated && _streamTask.Value != null)
|
||||
{
|
||||
_streamTask.Value.Catch(ex => TaskHelpers.Completed());
|
||||
_streamTask.Value.Catch(info => info.Handled());
|
||||
_streamTask = null;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
using System.ComponentModel;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace System.Web.Http
|
||||
namespace System.Net.Http
|
||||
{
|
||||
/// <summary>
|
||||
/// Provides extension methods for the <see cref="HttpRequestMessage"/> class.
|
||||
/// </summary>
|
||||
[EditorBrowsable(EditorBrowsableState.Never)]
|
||||
public static class HttpRequestMessageCommonExtensions
|
||||
public static class HttpRequestMessageExtensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Creates an <see cref="HttpResponseMessage"/> wired up to the associated <see cref="HttpRequestMessage"/>.
|
|
@ -1,547 +0,0 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq.Expressions;
|
||||
using System.Reflection;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace System.Net.Http.Internal
|
||||
{
|
||||
// TODO, DevDiv 336175, This is copied from System.Web.Http.Common, remove this copy once the issue is addressed.
|
||||
internal static class TaskExtensions
|
||||
{
|
||||
private static Task<AsyncVoid> _defaultCompleted = TaskHelpers.FromResult<AsyncVoid>(default(AsyncVoid));
|
||||
private static readonly Action<Task> _rethrowWithNoStackLossDelegate = GetRethrowWithNoStackLossDelegate();
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task completes, if it ends in a faulted state.
|
||||
/// Will not be called if the task did not fault (meaning, it will not be called if the task ran
|
||||
/// to completion or was canceled). Intended to roughly emulate C# 5's support for "try/catch" in
|
||||
/// async methods. Note that this method allows you to return a Task, so that you can either return
|
||||
/// a completed Task (indicating that you swallowed the exception) or a faulted task (indicating that
|
||||
/// that the exception should be propagated). In C#, you cannot normally use await within a catch
|
||||
/// block, so returning a real async task should never be done from Catch().
|
||||
/// </summary>
|
||||
internal static Task Catch(this Task task, Func<Exception, Task> continuation, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return task.CatchImpl(ex => continuation(ex).ToTask<AsyncVoid>(), cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task completes, if it ends in a faulted state.
|
||||
/// Will not be called if the task did not fault (meaning, it will not be called if the task ran
|
||||
/// to completion or was canceled). Intended to roughly emulate C# 5's support for "try/catch" in
|
||||
/// async methods. Note that this method allows you to return a Task, so that you can either return
|
||||
/// a completed Task (indicating that you swallowed the exception) or a faulted task (indicating that
|
||||
/// that the exception should be propagated). In C#, you cannot normally use await within a catch
|
||||
/// block, so returning a real async task should never be done from Catch().
|
||||
/// </summary>
|
||||
internal static Task<TResult> Catch<TResult>(this Task<TResult> task, Func<Exception, Task<TResult>> continuation, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return task.CatchImpl(continuation, cancellationToken);
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
private static Task<TResult> CatchImpl<TResult>(this Task task, Func<Exception, Task<TResult>> continuation, CancellationToken cancellationToken)
|
||||
{
|
||||
// Stay on the same thread if we can
|
||||
if (task.IsCanceled || cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
return TaskHelpers.Canceled<TResult>();
|
||||
}
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
try
|
||||
{
|
||||
Task<TResult> resultTask = continuation(task.Exception.GetBaseException());
|
||||
if (resultTask == null)
|
||||
{
|
||||
throw new InvalidOperationException(System.Net.Http.Properties.Resources.TaskExtensions_Catch_CannotReturnNull);
|
||||
}
|
||||
|
||||
return resultTask;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return TaskHelpers.FromError<TResult>(ex);
|
||||
}
|
||||
}
|
||||
if (task.Status == TaskStatus.RanToCompletion)
|
||||
{
|
||||
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
|
||||
tcs.TrySetFromTask(task);
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
SynchronizationContext syncContext = SynchronizationContext.Current;
|
||||
|
||||
return task.ContinueWith(innerTask =>
|
||||
{
|
||||
TaskCompletionSource<Task<TResult>> tcs = new TaskCompletionSource<Task<TResult>>();
|
||||
|
||||
if (innerTask.IsFaulted)
|
||||
{
|
||||
if (syncContext != null)
|
||||
{
|
||||
syncContext.Post(state =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Task<TResult> resultTask = continuation(innerTask.Exception.GetBaseException());
|
||||
if (resultTask == null)
|
||||
{
|
||||
throw new InvalidOperationException(System.Net.Http.Properties.Resources.TaskExtensions_Catch_CannotReturnNull);
|
||||
}
|
||||
|
||||
tcs.TrySetResult(resultTask);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
}, state: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
Task<TResult> resultTask = continuation(innerTask.Exception.GetBaseException());
|
||||
if (resultTask == null)
|
||||
{
|
||||
throw new InvalidOperationException(System.Net.Http.Properties.Resources.TaskExtensions_Catch_CannotReturnNull);
|
||||
}
|
||||
|
||||
tcs.TrySetResult(resultTask);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
tcs.TrySetFromTask(innerTask);
|
||||
}
|
||||
|
||||
return tcs.Task.FastUnwrap();
|
||||
}, cancellationToken).FastUnwrap();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upon completion of the task, copies its result into the given task completion source, regardless of the
|
||||
/// completion state. This causes the original task to be fully observed, and the task that is returned by
|
||||
/// this method will always successfully run to completion, regardless of the original task state.
|
||||
/// Since this method consumes a task with no return value, you must provide the return value to be used
|
||||
/// when the inner task ran to successful completion.
|
||||
/// </summary>
|
||||
internal static Task CopyResultToCompletionSource<TResult>(this Task task, TaskCompletionSource<TResult> tcs, TResult completionResult)
|
||||
{
|
||||
return task.CopyResultToCompletionSourceImpl(tcs, innerTask => completionResult);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Upon completion of the task, copies its result into the given task completion source, regardless of the
|
||||
/// completion state. This causes the original task to be fully observed, and the task that is returned by
|
||||
/// this method will always successfully run to completion, regardless of the original task state.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
internal static Task CopyResultToCompletionSource<TResult>(this Task<TResult> task, TaskCompletionSource<TResult> tcs)
|
||||
{
|
||||
return task.CopyResultToCompletionSourceImpl(tcs, innerTask => innerTask.Result);
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
private static Task CopyResultToCompletionSourceImpl<TTask, TResult>(this TTask task, TaskCompletionSource<TResult> tcs, Func<TTask, TResult> resultThunk)
|
||||
where TTask : Task
|
||||
{
|
||||
if (task.IsCompleted)
|
||||
{
|
||||
switch (task.Status)
|
||||
{
|
||||
case TaskStatus.Canceled:
|
||||
case TaskStatus.Faulted:
|
||||
TaskHelpers.TrySetFromTask(tcs, task);
|
||||
break;
|
||||
|
||||
case TaskStatus.RanToCompletion:
|
||||
tcs.TrySetResult(resultThunk(task));
|
||||
break;
|
||||
}
|
||||
|
||||
return TaskHelpers.Completed();
|
||||
}
|
||||
|
||||
return task.ContinueWith(innerTask =>
|
||||
{
|
||||
switch (innerTask.Status)
|
||||
{
|
||||
case TaskStatus.Canceled:
|
||||
case TaskStatus.Faulted:
|
||||
TaskHelpers.TrySetFromTask(tcs, innerTask);
|
||||
break;
|
||||
|
||||
case TaskStatus.RanToCompletion:
|
||||
tcs.TrySetResult(resultThunk(task));
|
||||
break;
|
||||
}
|
||||
}, TaskContinuationOptions.ExecuteSynchronously);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A version of task.Unwrap that is optimized to prevent unnecessarily capturing the
|
||||
/// execution context when the antecedent task is already completed.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4000:DoNotUseProblematicTaskTypes", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
internal static Task FastUnwrap(this Task<Task> task)
|
||||
{
|
||||
Task innerTask = task.Status == TaskStatus.RanToCompletion ? task.Result : null;
|
||||
return innerTask ?? task.Unwrap();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A version of task.Unwrap that is optimized to prevent unnecessarily capturing the
|
||||
/// execution context when the antecedent task is already completed.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4000:DoNotUseProblematicTaskTypes", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
internal static Task<TResult> FastUnwrap<TResult>(this Task<Task<TResult>> task)
|
||||
{
|
||||
Task<TResult> innerTask = task.Status == TaskStatus.RanToCompletion ? task.Result : null;
|
||||
return innerTask ?? task.Unwrap();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task has completed, regardless of the state
|
||||
/// the task ended in. Intended to roughly emulate C# 5's support for "finally" in async methods.
|
||||
/// </summary>
|
||||
internal static Task Finally(this Task task, Action continuation)
|
||||
{
|
||||
return task.FinallyImpl<AsyncVoid>(continuation);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task has completed, regardless of the state
|
||||
/// the task ended in. Intended to roughly emulate C# 5's support for "finally" in async methods.
|
||||
/// </summary>
|
||||
internal static Task<TResult> Finally<TResult>(this Task<TResult> task, Action continuation)
|
||||
{
|
||||
return task.FinallyImpl<TResult>(continuation);
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
private static Task<TResult> FinallyImpl<TResult>(this Task task, Action continuation)
|
||||
{
|
||||
// Stay on the same thread if we can
|
||||
if (task.IsCompleted)
|
||||
{
|
||||
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
|
||||
try
|
||||
{
|
||||
continuation();
|
||||
tcs.TrySetFromTask(task);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
SynchronizationContext syncContext = SynchronizationContext.Current;
|
||||
|
||||
return task.ContinueWith(innerTask =>
|
||||
{
|
||||
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
|
||||
if (syncContext != null)
|
||||
{
|
||||
syncContext.Post(state =>
|
||||
{
|
||||
try
|
||||
{
|
||||
continuation();
|
||||
tcs.TrySetFromTask(innerTask);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.SetException(ex);
|
||||
}
|
||||
}, state: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
continuation();
|
||||
tcs.TrySetFromTask(innerTask);
|
||||
}
|
||||
|
||||
return tcs.Task;
|
||||
}).FastUnwrap();
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Usage", "CA2201:DoNotRaiseReservedExceptionTypes", Justification = "This general exception is not intended to be seen by the user")]
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "This general exception is not intended to be seen by the user")]
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
private static Action<Task> GetRethrowWithNoStackLossDelegate()
|
||||
{
|
||||
MethodInfo getAwaiterMethod = typeof(Task).GetMethod("GetAwaiter", Type.EmptyTypes);
|
||||
if (getAwaiterMethod != null)
|
||||
{
|
||||
// .NET 4.5 - dump the same code the 'await' keyword would have dumped
|
||||
// >> task.GetAwaiter().GetResult()
|
||||
// No-ops if the task completed successfully, else throws the originating exception complete with the correct call stack.
|
||||
var taskParameter = Expression.Parameter(typeof(Task));
|
||||
var getAwaiterCall = Expression.Call(taskParameter, getAwaiterMethod);
|
||||
var getResultCall = Expression.Call(getAwaiterCall, "GetResult", Type.EmptyTypes);
|
||||
var lambda = Expression.Lambda<Action<Task>>(getResultCall, taskParameter);
|
||||
return lambda.Compile();
|
||||
}
|
||||
else
|
||||
{
|
||||
Func<Exception, Exception> prepForRemoting = null;
|
||||
|
||||
try
|
||||
{
|
||||
if (AppDomain.CurrentDomain.IsFullyTrusted)
|
||||
{
|
||||
// .NET 4 - do the same thing Lazy<T> does by calling Exception.PrepForRemoting
|
||||
// This is an internal method in mscorlib.dll, so pass a test Exception to it to make sure we can call it.
|
||||
var exceptionParameter = Expression.Parameter(typeof(Exception));
|
||||
var prepForRemotingCall = Expression.Call(exceptionParameter, "PrepForRemoting", Type.EmptyTypes);
|
||||
var lambda = Expression.Lambda<Func<Exception, Exception>>(prepForRemotingCall, exceptionParameter);
|
||||
var func = lambda.Compile();
|
||||
func(new Exception()); // make sure the method call succeeds before assigning the 'prepForRemoting' local variable
|
||||
prepForRemoting = func;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
} // If delegate creation fails (medium trust) we will simply throw the base exception.
|
||||
|
||||
return task =>
|
||||
{
|
||||
try
|
||||
{
|
||||
task.Wait();
|
||||
}
|
||||
catch (AggregateException ex)
|
||||
{
|
||||
Exception baseException = ex.GetBaseException();
|
||||
if (prepForRemoting != null)
|
||||
{
|
||||
baseException = prepForRemoting(baseException);
|
||||
}
|
||||
throw baseException;
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task has completed, if the task successfully ran
|
||||
/// to completion (i.e., was not cancelled and did not fault).
|
||||
/// </summary>
|
||||
internal static Task Then(this Task task, Action continuation, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return task.ThenImpl(t => ToAsyncVoidTask(continuation), cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task has completed, if the task successfully ran
|
||||
/// to completion (i.e., was not cancelled and did not fault).
|
||||
/// </summary>
|
||||
internal static Task<TOuterResult> Then<TOuterResult>(this Task task, Func<TOuterResult> continuation, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return task.ThenImpl(t => TaskHelpers.FromResult(continuation()), cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task has completed, if the task successfully ran
|
||||
/// to completion (i.e., was not cancelled and did not fault).
|
||||
/// </summary>
|
||||
internal static Task<TOuterResult> Then<TOuterResult>(this Task task, Func<Task<TOuterResult>> continuation, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return task.ThenImpl(t => continuation(), cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task has completed, if the task successfully ran
|
||||
/// to completion (i.e., was not cancelled and did not fault). The continuation is provided with the
|
||||
/// result of the task as its sole parameter.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
internal static Task Then<TInnerResult>(this Task<TInnerResult> task, Action<TInnerResult> continuation, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return task.ThenImpl(t => ToAsyncVoidTask(() => continuation(t.Result)), cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task has completed, if the task successfully ran
|
||||
/// to completion (i.e., was not cancelled and did not fault). The continuation is provided with the
|
||||
/// result of the task as its sole parameter.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
internal static Task<TOuterResult> Then<TInnerResult, TOuterResult>(this Task<TInnerResult> task, Func<TInnerResult, TOuterResult> continuation, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return task.ThenImpl(t => TaskHelpers.FromResult(continuation(t.Result)), cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Calls the given continuation, after the given task has completed, if the task successfully ran
|
||||
/// to completion (i.e., was not cancelled and did not fault). The continuation is provided with the
|
||||
/// result of the task as its sole parameter.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
internal static Task<TOuterResult> Then<TInnerResult, TOuterResult>(this Task<TInnerResult> task, Func<TInnerResult, Task<TOuterResult>> continuation, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return task.ThenImpl(t => continuation(t.Result), cancellationToken);
|
||||
}
|
||||
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
private static Task<TOuterResult> ThenImpl<TTask, TOuterResult>(this TTask task, Func<TTask, Task<TOuterResult>> continuation, CancellationToken cancellationToken)
|
||||
where TTask : Task
|
||||
{
|
||||
// Stay on the same thread if we can
|
||||
if (task.IsCanceled || cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
return TaskHelpers.Canceled<TOuterResult>();
|
||||
}
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
return TaskHelpers.FromErrors<TOuterResult>(task.Exception.InnerExceptions);
|
||||
}
|
||||
if (task.Status == TaskStatus.RanToCompletion)
|
||||
{
|
||||
try
|
||||
{
|
||||
return continuation(task);
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
return TaskHelpers.FromError<TOuterResult>(ex);
|
||||
}
|
||||
}
|
||||
|
||||
SynchronizationContext syncContext = SynchronizationContext.Current;
|
||||
|
||||
return task.ContinueWith(innerTask =>
|
||||
{
|
||||
if (innerTask.IsFaulted)
|
||||
{
|
||||
return TaskHelpers.FromErrors<TOuterResult>(innerTask.Exception.InnerExceptions);
|
||||
}
|
||||
if (innerTask.IsCanceled)
|
||||
{
|
||||
return TaskHelpers.Canceled<TOuterResult>();
|
||||
}
|
||||
|
||||
TaskCompletionSource<Task<TOuterResult>> tcs = new TaskCompletionSource<Task<TOuterResult>>();
|
||||
if (syncContext != null)
|
||||
{
|
||||
syncContext.Post(state =>
|
||||
{
|
||||
try
|
||||
{
|
||||
tcs.TrySetResult(continuation(task));
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
tcs.TrySetException(ex);
|
||||
}
|
||||
}, state: null);
|
||||
}
|
||||
else
|
||||
{
|
||||
tcs.TrySetResult(continuation(task));
|
||||
}
|
||||
return tcs.Task.FastUnwrap();
|
||||
}, cancellationToken).FastUnwrap();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Throws the first faulting exception for a task which is faulted. It attempts to preserve the original
|
||||
/// stack trace when throwing the exception (which should always work in 4.5, and should also work in 4.0
|
||||
/// when running in full trust). Note: It is the caller's responsibility not to pass incomplete tasks to
|
||||
/// this method, because it does degenerate into a call to the equivalent of .Wait() on the task when it
|
||||
/// hasn't yet completed.
|
||||
/// </summary>
|
||||
internal static void ThrowIfFaulted(this Task task)
|
||||
{
|
||||
_rethrowWithNoStackLossDelegate(task);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Adapts any action into a Task (returning AsyncVoid, so that it's usable with Task{T} extension methods).
|
||||
/// </summary>
|
||||
private static Task<AsyncVoid> ToAsyncVoidTask(Action action)
|
||||
{
|
||||
return TaskHelpers.RunSynchronously<AsyncVoid>(() =>
|
||||
{
|
||||
action();
|
||||
return _defaultCompleted;
|
||||
});
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Changes the return value of a task to the given result, if the task ends in the RanToCompletion state.
|
||||
/// This potentially imposes an extra ContinueWith to convert a non-completed task, so use this with caution.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
internal static Task<TResult> ToTask<TResult>(this Task task, CancellationToken cancellationToken = default(CancellationToken), TResult result = default(TResult))
|
||||
{
|
||||
if (task == null)
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
// Stay on the same thread if we can
|
||||
if (task.IsCanceled || cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
return TaskHelpers.Canceled<TResult>();
|
||||
}
|
||||
if (task.IsFaulted)
|
||||
{
|
||||
return TaskHelpers.FromErrors<TResult>(task.Exception.InnerExceptions);
|
||||
}
|
||||
if (task.Status == TaskStatus.RanToCompletion)
|
||||
{
|
||||
return TaskHelpers.FromResult(result);
|
||||
}
|
||||
|
||||
return task.ContinueWith(innerTask =>
|
||||
{
|
||||
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
|
||||
|
||||
if (task.Status == TaskStatus.RanToCompletion)
|
||||
{
|
||||
tcs.TrySetResult(result);
|
||||
}
|
||||
else
|
||||
{
|
||||
tcs.TrySetFromTask(innerTask);
|
||||
}
|
||||
|
||||
return tcs.Task;
|
||||
}, TaskContinuationOptions.ExecuteSynchronously).FastUnwrap();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attempts to get the result value for the given task. If the task ran to completion, then
|
||||
/// it will return true and set the result value; otherwise, it will return false.
|
||||
/// </summary>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "The usages here are deemed safe, and provide the implementations that this rule relies upon.")]
|
||||
internal static bool TryGetResult<TResult>(this Task<TResult> task, out TResult result)
|
||||
{
|
||||
if (task.Status == TaskStatus.RanToCompletion)
|
||||
{
|
||||
result = task.Result;
|
||||
return true;
|
||||
}
|
||||
|
||||
result = default(TResult);
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used as the T in a "conversion" of a Task into a Task{T}.
|
||||
/// </summary>
|
||||
private struct AsyncVoid
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -1,384 +0,0 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace System.Net.Http.Internal
|
||||
{
|
||||
// TODO, DevDiv 336175, This is copied from System.Web.Http.Common, remove this copy once the issue is addressed.
|
||||
|
||||
/// <summary>
|
||||
/// Helpers for safely using Task libraries.
|
||||
/// </summary>
|
||||
internal static class TaskHelpers
|
||||
{
|
||||
private static Task _defaultCompleted = FromResult<AsyncVoid>(default(AsyncVoid));
|
||||
|
||||
/// <summary>
|
||||
/// Returns a canceled Task. The task is completed, IsCanceled = True, IsFaulted = False.
|
||||
/// </summary>
|
||||
internal static Task Canceled()
|
||||
{
|
||||
return CancelCache<AsyncVoid>.Canceled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a canceled Task of the given type. The task is completed, IsCanceled = True, IsFaulted = False.
|
||||
/// </summary>
|
||||
internal static Task<TResult> Canceled<TResult>()
|
||||
{
|
||||
return CancelCache<TResult>.Canceled;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a completed task that has no result.
|
||||
/// </summary>
|
||||
internal static Task Completed()
|
||||
{
|
||||
return _defaultCompleted;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an error task. The task is Completed, IsCanceled = False, IsFaulted = True
|
||||
/// </summary>
|
||||
internal static Task FromError(Exception exception)
|
||||
{
|
||||
return FromError<AsyncVoid>(exception);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an error task of the given type. The task is Completed, IsCanceled = False, IsFaulted = True
|
||||
/// </summary>
|
||||
/// <typeparam name="TResult"></typeparam>
|
||||
internal static Task<TResult> FromError<TResult>(Exception exception)
|
||||
{
|
||||
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
|
||||
tcs.SetException(exception);
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an error task of the given type. The task is Completed, IsCanceled = False, IsFaulted = True
|
||||
/// </summary>
|
||||
internal static Task FromErrors(IEnumerable<Exception> exceptions)
|
||||
{
|
||||
return FromErrors<AsyncVoid>(exceptions);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns an error task of the given type. The task is Completed, IsCanceled = False, IsFaulted = True
|
||||
/// </summary>
|
||||
internal static Task<TResult> FromErrors<TResult>(IEnumerable<Exception> exceptions)
|
||||
{
|
||||
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
|
||||
tcs.SetException(exceptions);
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns a successful completed task with the given result.
|
||||
/// </summary>
|
||||
internal static Task<TResult> FromResult<TResult>(TResult result)
|
||||
{
|
||||
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
|
||||
tcs.SetResult(result);
|
||||
return tcs.Task;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a task that runs all the tasks inside the iterator sequentially. It stops as soon
|
||||
/// as one of the tasks fails or cancels, or after all the tasks have run succesfully.
|
||||
/// </summary>
|
||||
/// <param name="asyncIterator">collection of tasks to wait on</param>
|
||||
/// <param name="cancellationToken">cancellation token</param>
|
||||
/// <returns>a task that signals completed when all the incoming tasks are finished.</returns>
|
||||
internal static Task Iterate(IEnumerable<Task> asyncIterator, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
return Iterate(WrapIterator(asyncIterator), cancellationToken);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Return a task that runs all the tasks inside the iterator sequentially and collects the results.
|
||||
/// It stops as soon as one of the tasks fails or cancels, or after all the tasks have run succesfully.
|
||||
/// </summary>
|
||||
/// <param name="asyncIterator">collection of tasks to wait on</param>
|
||||
/// <param name="cancellationToken">cancellation token</param>
|
||||
/// <returns>A task that, upon successful completion, returns the list of results.</returns>
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "This usage is known to be safe.")]
|
||||
internal static Task<IEnumerable<TResult>> Iterate<TResult>(IEnumerable<Task<TResult>> asyncIterator, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
Contract.Assert(asyncIterator != null);
|
||||
|
||||
List<TResult> results = new List<TResult>();
|
||||
IEnumerator<Task<TResult>> enumerator = asyncIterator.GetEnumerator();
|
||||
TaskCompletionSource<IEnumerable<TResult>> tcs = new TaskCompletionSource<IEnumerable<TResult>>();
|
||||
Action recursiveBody = null;
|
||||
|
||||
recursiveBody = () =>
|
||||
{
|
||||
try
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
tcs.TrySetCanceled();
|
||||
}
|
||||
else if (enumerator.MoveNext())
|
||||
{
|
||||
enumerator.Current.ContinueWith(previous =>
|
||||
{
|
||||
switch (previous.Status)
|
||||
{
|
||||
case TaskStatus.Faulted:
|
||||
case TaskStatus.Canceled:
|
||||
tcs.TrySetFromTask(previous);
|
||||
break;
|
||||
|
||||
default:
|
||||
results.Add(previous.Result);
|
||||
recursiveBody();
|
||||
break;
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
tcs.TrySetResult(results);
|
||||
}
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
tcs.TrySetException(e);
|
||||
}
|
||||
};
|
||||
|
||||
recursiveBody();
|
||||
return tcs.Task.Finally(enumerator.Dispose);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replacement for Task.Factory.StartNew when the code can run synchronously.
|
||||
/// We run the code immediately and avoid the thread switch.
|
||||
/// This is used to help synchronous code implement task interfaces.
|
||||
/// </summary>
|
||||
/// <param name="action">action to run synchronouslyt</param>
|
||||
/// <param name="token">cancellation token. This is only checked before we run the task, and if cancelled, we immediately return a cancelled task.</param>
|
||||
/// <returns>a task who result is the result from Func()</returns>
|
||||
/// <remarks>
|
||||
/// Avoid calling Task.Factory.StartNew.
|
||||
/// This avoids gotchas with StartNew:
|
||||
/// - ensures cancellation token is checked (StartNew doesn't check cancellation tokens).
|
||||
/// - Keeps on the same thread.
|
||||
/// - Avoids switching synchronization contexts.
|
||||
/// Also take in a lambda so that we can wrap in a try catch and honor task failure semantics.
|
||||
/// </remarks>
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
|
||||
public static Task RunSynchronously(Action action, CancellationToken token = default(CancellationToken))
|
||||
{
|
||||
if (token.IsCancellationRequested)
|
||||
{
|
||||
return Canceled();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
action();
|
||||
return Completed();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return FromError(e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Replacement for Task.Factory.StartNew when the code can run synchronously.
|
||||
/// We run the code immediately and avoid the thread switch.
|
||||
/// This is used to help synchronous code implement task interfaces.
|
||||
/// </summary>
|
||||
/// <typeparam name="TResult">type of result that task will return.</typeparam>
|
||||
/// <param name="func">function to run synchronously and produce result</param>
|
||||
/// <param name="cancellationToken">cancellation token. This is only checked before we run the task, and if cancelled, we immediately return a cancelled task.</param>
|
||||
/// <returns>a task who result is the result from Func()</returns>
|
||||
/// <remarks>
|
||||
/// Avoid calling Task.Factory.StartNew.
|
||||
/// This avoids gotchas with StartNew:
|
||||
/// - ensures cancellation token is checked (StartNew doesn't check cancellation tokens).
|
||||
/// - Keeps on the same thread.
|
||||
/// - Avoids switching synchronization contexts.
|
||||
/// Also take in a lambda so that we can wrap in a try catch and honor task failure semantics.
|
||||
/// </remarks>
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
|
||||
internal static Task<TResult> RunSynchronously<TResult>(Func<TResult> func, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
return Canceled<TResult>();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return FromResult(func());
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return FromError<TResult>(e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Overload of RunSynchronously that avoids a call to Unwrap().
|
||||
/// This overload is useful when func() starts doing some synchronous work and then hits IO and
|
||||
/// needs to create a task to finish the work.
|
||||
/// </summary>
|
||||
/// <typeparam name="TResult">type of result that Task will return</typeparam>
|
||||
/// <param name="func">function that returns a task</param>
|
||||
/// <param name="cancellationToken">cancellation token. This is only checked before we run the task, and if cancelled, we immediately return a cancelled task.</param>
|
||||
/// <returns>a task, created by running func().</returns>
|
||||
[SuppressMessage("Microsoft.Design", "CA1031:DoNotCatchGeneralExceptionTypes", Justification = "The caught exception type is reflected into a faulted task.")]
|
||||
internal static Task<TResult> RunSynchronously<TResult>(Func<Task<TResult>> func, CancellationToken cancellationToken = default(CancellationToken))
|
||||
{
|
||||
if (cancellationToken.IsCancellationRequested)
|
||||
{
|
||||
return Canceled<TResult>();
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return func();
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
return FromError<TResult>(e);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Update the completion source if the task failed (cancelled or faulted). No change to completion source if the task succeeded.
|
||||
/// </summary>
|
||||
/// <typeparam name="TResult">result type of completion source</typeparam>
|
||||
/// <param name="tcs">completion source to update</param>
|
||||
/// <param name="source">task to update from.</param>
|
||||
/// <returns>true on success</returns>
|
||||
internal static bool SetIfTaskFailed<TResult>(this TaskCompletionSource<TResult> tcs, Task source)
|
||||
{
|
||||
switch (source.Status)
|
||||
{
|
||||
case TaskStatus.Canceled:
|
||||
case TaskStatus.Faulted:
|
||||
return tcs.TrySetFromTask(source);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set a completion source from the given Task.
|
||||
/// </summary>
|
||||
/// <typeparam name="TResult">result type for completion source.</typeparam>
|
||||
/// <param name="tcs">completion source to set</param>
|
||||
/// <param name="source">Task to get values from.</param>
|
||||
/// <returns>true if this successfully sets the completion source.</returns>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "This is a known safe usage of Task.Result, since it only occurs when we know the task's state to be completed.")]
|
||||
internal static bool TrySetFromTask<TResult>(this TaskCompletionSource<TResult> tcs, Task source)
|
||||
{
|
||||
if (source.Status == TaskStatus.Canceled)
|
||||
{
|
||||
return tcs.TrySetCanceled();
|
||||
}
|
||||
|
||||
if (source.Status == TaskStatus.Faulted)
|
||||
{
|
||||
return tcs.TrySetException(source.Exception.InnerExceptions);
|
||||
}
|
||||
|
||||
if (source.Status == TaskStatus.RanToCompletion)
|
||||
{
|
||||
Task<TResult> taskOfResult = source as Task<TResult>;
|
||||
return tcs.TrySetResult(taskOfResult == null ? default(TResult) : taskOfResult.Result);
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set a completion source from the given Task. If the task ran to completion and the result type doesn't match
|
||||
/// the type of the completion source, then a default value will be used. This is useful for converting Task into
|
||||
/// Task{AsyncVoid}, but it can also accidentally be used to introduce data loss (by passing the wrong
|
||||
/// task type), so please execute this method with care.
|
||||
/// </summary>
|
||||
/// <typeparam name="TResult">result type for completion source.</typeparam>
|
||||
/// <param name="tcs">completion source to set</param>
|
||||
/// <param name="source">Task to get values from.</param>
|
||||
/// <returns>true if this successfully sets the completion source.</returns>
|
||||
[SuppressMessage("Microsoft.WebAPI", "CR4001:DoNotCallProblematicMethodsOnTask", Justification = "This is a known safe usage of Task.Result, since it only occurs when we know the task's state to be completed.")]
|
||||
internal static bool TrySetFromTask<TResult>(this TaskCompletionSource<Task<TResult>> tcs, Task source)
|
||||
{
|
||||
if (source.Status == TaskStatus.Canceled)
|
||||
{
|
||||
return tcs.TrySetCanceled();
|
||||
}
|
||||
|
||||
if (source.Status == TaskStatus.Faulted)
|
||||
{
|
||||
return tcs.TrySetException(source.Exception.InnerExceptions);
|
||||
}
|
||||
|
||||
if (source.Status == TaskStatus.RanToCompletion)
|
||||
{
|
||||
// Sometimes the source task is Task<Task<TResult>>, and sometimes it's Task<TResult>.
|
||||
// The latter usually happens when we're in the middle of a sync-block postback where
|
||||
// the continuation is a function which returns Task<TResult> rather than just TResult,
|
||||
// but the originating task was itself just Task<TResult>. An example of this can be
|
||||
// found in TaskExtensions.CatchImpl().
|
||||
Task<Task<TResult>> taskOfTaskOfResult = source as Task<Task<TResult>>;
|
||||
if (taskOfTaskOfResult != null)
|
||||
{
|
||||
return tcs.TrySetResult(taskOfTaskOfResult.Result);
|
||||
}
|
||||
|
||||
Task<TResult> taskOfResult = source as Task<TResult>;
|
||||
if (taskOfResult != null)
|
||||
{
|
||||
return tcs.TrySetResult(taskOfResult);
|
||||
}
|
||||
|
||||
return tcs.TrySetResult(TaskHelpers.FromResult(default(TResult)));
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
private static IEnumerable<Task<AsyncVoid>> WrapIterator(IEnumerable<Task> tasks)
|
||||
{
|
||||
foreach (Task task in tasks)
|
||||
{
|
||||
yield return task.ToTask<AsyncVoid>();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Used as the T in a "conversion" of a Task into a Task{T}
|
||||
/// </summary>
|
||||
private struct AsyncVoid
|
||||
{
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// This class is a convenient cache for per-type cancelled tasks
|
||||
/// </summary>
|
||||
/// <typeparam name="TResult"></typeparam>
|
||||
private static class CancelCache<TResult>
|
||||
{
|
||||
public static readonly Task<TResult> Canceled = GetCancelledTask();
|
||||
|
||||
private static Task<TResult> GetCancelledTask()
|
||||
{
|
||||
TaskCompletionSource<TResult> tcs = new TaskCompletionSource<TResult>();
|
||||
tcs.SetCanceled();
|
||||
return tcs.Task;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -12,5 +12,3 @@ using System.Runtime.InteropServices;
|
|||
[assembly: InternalsVisibleTo("System.Net.Http.Formatting.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
[assembly: InternalsVisibleTo("System.Net.Http.Formatting.Test.Integration, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
[assembly: InternalsVisibleTo("System.Net.Http.Formatting.OData.Test.Unit, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
/* TODO: Remove */
|
||||
[assembly: InternalsVisibleTo("System.Web.Http, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
|
|
|
@ -501,15 +501,6 @@ namespace System.Net.Http.Properties {
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to The return value from a Catch() lambda cannot return null..
|
||||
/// </summary>
|
||||
internal static string TaskExtensions_Catch_CannotReturnNull {
|
||||
get {
|
||||
return ResourceManager.GetString("TaskExtensions_Catch_CannotReturnNull", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Looks up a localized string similar to 'undefined'.
|
||||
/// </summary>
|
||||
|
|
|
@ -228,10 +228,6 @@
|
|||
<data name="UnsupportedIndent" xml:space="preserve">
|
||||
<value>Indentation is not supported by '{0}'.</value>
|
||||
</data>
|
||||
<data name="TaskExtensions_Catch_CannotReturnNull" xml:space="preserve">
|
||||
<value>The return value from a Catch() lambda cannot return null.</value>
|
||||
<comment>TaskExtensions_Catch_CannotReturnNull description</comment>
|
||||
</data>
|
||||
<data name="MediaTypeFormatterCannotRead" xml:space="preserve">
|
||||
<value>The media type formatter of type '{0}' does not support reading since it does not implement the ReadFromStreamAsync method.</value>
|
||||
</data>
|
||||
|
|
|
@ -66,6 +66,15 @@
|
|||
<Compile Include="..\CommonAssemblyInfo.cs">
|
||||
<Link>Properties\CommonAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\Error.cs">
|
||||
<Link>Common\Error.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\TaskHelpers.cs">
|
||||
<Link>Common\TaskHelpers.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\TaskHelpersExtensions.cs">
|
||||
<Link>Common\TaskHelpersExtensions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\RS.cs">
|
||||
<Link>RS.cs</Link>
|
||||
</Compile>
|
||||
|
@ -82,6 +91,7 @@
|
|||
<Compile Include="Formatting\IFormatterLogger.cs" />
|
||||
<Compile Include="Formatting\IRequiredMemberSelector.cs" />
|
||||
<Compile Include="HttpClientExtensions.cs" />
|
||||
<Compile Include="HttpRequestMessageExtensions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\Resources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
|
@ -141,10 +151,23 @@
|
|||
<Compile Include="MultipartMemoryStreamProvider.cs" />
|
||||
<Compile Include="ObjectContent.cs" />
|
||||
<Compile Include="Formatting\Parsers\ParserState.cs" />
|
||||
<Compile Include="Internal\TaskHelpers.cs" />
|
||||
<Compile Include="UriExtensions.cs" />
|
||||
<Compile Include="Internal\UriQueryUtility.cs" />
|
||||
<Compile Include="Internal\TaskExtensions.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Common\CommonWebApiResources.Designer.cs">
|
||||
<Link>Properties\CommonWebApiResources.Designer.cs</Link>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>CommonWebApiResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\Common\CommonWebApiResources.resx">
|
||||
<Link>Properties\CommonWebApiResources.resx</Link>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>CommonWebApiResources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\Resources.resx">
|
||||
|
|
|
@ -1,5 +0,0 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
|
||||
[assembly: SuppressMessage("Microsoft.Design", "CA2210:AssembliesShouldHaveValidStrongNames", Justification = "Will be signed")]
|
||||
[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Web.Http")]
|
||||
[assembly: SuppressMessage("Microsoft.Design", "CA1020:AvoidNamespacesWithFewTypes", Scope = "namespace", Target = "System.Web.Http.Common")]
|
|
@ -1,16 +0,0 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
|
||||
[assembly: AssemblyTitle("System.Web.Http.Common")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: InternalsVisibleTo("System.Web.Http, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
[assembly: InternalsVisibleTo("System.Web.Http.Common.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
[assembly: InternalsVisibleTo("System.Web.Http.SelfHost, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
[assembly: InternalsVisibleTo("System.Web.Http.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
[assembly: InternalsVisibleTo("System.Web.Http.WebHost, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
[assembly: InternalsVisibleTo("System.Web.Mvc, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
||||
[assembly: InternalsVisibleTo("System.Web.Mvc.Test, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
|
|
@ -1,93 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Runtime.sln))\tools\WebStack.settings.targets" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<CodeAnalysis Condition=" '$(CodeAnalysis)' == '' ">false</CodeAnalysis>
|
||||
<ProductVersion>9.0.30729</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>System.Web.Http.Common</RootNamespace>
|
||||
<AssemblyName>System.Web.Http.Common</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\bin\Debug\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;ASPNETMVC</DefineConstants>
|
||||
<CodeAnalysisRuleSet>..\Strict.ruleset</CodeAnalysisRuleSet>
|
||||
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;ASPNETMVC</DefineConstants>
|
||||
<CodeAnalysisRuleSet>..\Strict.ruleset</CodeAnalysisRuleSet>
|
||||
<RunCodeAnalysis>$(CodeAnalysis)</RunCodeAnalysis>
|
||||
<DocumentationFile>$(OutputPath)\$(AssemblyName).xml</DocumentationFile>
|
||||
<NoWarn>1591</NoWarn>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'CodeCoverage|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<OutputPath>..\..\bin\CodeCoverage\</OutputPath>
|
||||
<DefineConstants>TRACE;DEBUG;CODE_COVERAGE;ASPNETMVC</DefineConstants>
|
||||
<DebugType>full</DebugType>
|
||||
<CodeAnalysisRuleSet>..\Strict.ruleset</CodeAnalysisRuleSet>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Net.Http">
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.0.20302.1\lib\net40\System.Net.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest">
|
||||
<HintPath>..\..\packages\Microsoft.Net.Http.2.0.20302.1\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\CommonAssemblyInfo.cs">
|
||||
<Link>Properties\CommonAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\TransparentCommonAssemblyInfo.cs">
|
||||
<Link>Properties\TransparentCommonAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Error.cs" />
|
||||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="HttpMethodHelper.cs" />
|
||||
<Compile Include="HttpRequestMessageCommonExtensions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="Properties\SRResources.Designer.cs">
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>SRResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="TaskHelpersExtensions.cs" />
|
||||
<Compile Include="TaskHelpers.cs" />
|
||||
<Compile Include="RouteParameter.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\SRResources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>SRResources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<CodeAnalysisDictionary Include="..\CodeAnalysisDictionary.xml">
|
||||
<Link>CodeAnalysisDictionary.xml</Link>
|
||||
</CodeAnalysisDictionary>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
</Project>
|
|
@ -1,4 +0,0 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Net.Http" version="2.0.20302.1" />
|
||||
</packages>
|
|
@ -2,7 +2,6 @@ using System.ComponentModel;
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.ServiceModel;
|
||||
using System.Web.Http.SelfHost.ServiceModel.Channels;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.ComponentModel;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.SelfHost.Channels
|
||||
{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Diagnostics.Contracts;
|
||||
using System.Net.Http;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
using System.Xml;
|
||||
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.IO;
|
|||
using System.Net.Http;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
using System.Web.Http.SelfHost.ServiceModel.Channels;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
|
||||
namespace System.Web.Http.SelfHost.Channels
|
||||
|
|
|
@ -6,7 +6,6 @@ using System.Net;
|
|||
using System.Net.Http;
|
||||
using System.Net.Http.Headers;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
|
||||
namespace System.Web.Http.SelfHost.Channels
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Net.Http;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.SelfHost.Channels
|
||||
{
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.ServiceModel;
|
|||
using System.ServiceModel.Channels;
|
||||
using System.ServiceModel.Description;
|
||||
using System.ServiceModel.Security;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Channels;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
using System.Web.Http.SelfHost.ServiceModel;
|
||||
|
|
|
@ -9,7 +9,6 @@ using System.ServiceModel.Channels;
|
|||
using System.ServiceModel.Security;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Hosting;
|
||||
using System.Web.Http.SelfHost.Channels;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
|
|
|
@ -2,7 +2,6 @@ using System.Diagnostics;
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Threading;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
|
||||
namespace System.Web.Http.SelfHost.ServiceModel.Channels
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Diagnostics;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.SelfHost.ServiceModel.Channels
|
||||
{
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Diagnostics;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.IO;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
|
||||
namespace System.Web.Http.SelfHost.ServiceModel.Channels
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Threading;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
|
||||
namespace System.Web.Http.SelfHost.ServiceModel.Channels
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
|
||||
namespace System.Web.Http.SelfHost.ServiceModel.Channels
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.ServiceModel;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.SelfHost.ServiceModel
|
||||
{
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
using System.Net;
|
||||
using System.ServiceModel;
|
||||
using System.ServiceModel.Channels;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.SelfHost.Properties;
|
||||
|
||||
namespace System.Web.Http.SelfHost.ServiceModel
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.ServiceModel;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.SelfHost.ServiceModel
|
||||
{
|
||||
|
|
|
@ -63,6 +63,18 @@
|
|||
<Compile Include="..\CommonAssemblyInfo.cs">
|
||||
<Link>Properties\CommonAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\Error.cs">
|
||||
<Link>Common\Error.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\HttpMethodHelper.cs">
|
||||
<Link>Common\HttpMethodHelper.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\TaskHelpers.cs">
|
||||
<Link>Common\TaskHelpers.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\TaskHelpersExtensions.cs">
|
||||
<Link>Common\TaskHelpersExtensions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\TransparentCommonAssemblyInfo.cs">
|
||||
<Link>Properties\TransparentCommonAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
|
@ -107,6 +119,21 @@
|
|||
<Compile Include="GlobalSuppressions.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Common\CommonWebApiResources.Designer.cs">
|
||||
<Link>Properties\CommonWebApiResources.Designer.cs</Link>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>CommonWebApiResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\Common\CommonWebApiResources.resx">
|
||||
<Link>Properties\CommonWebApiResources.resx</Link>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>CommonWebApiResources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\SRResources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
@ -114,9 +141,9 @@
|
|||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\System.Web.Http.Common\System.Web.Http.Common.csproj">
|
||||
<Project>{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}</Project>
|
||||
<Name>System.Web.Http.Common</Name>
|
||||
<ProjectReference Include="..\System.Net.Http.Formatting\System.Net.Http.Formatting.csproj">
|
||||
<Project>{668E9021-CE84-49D9-98FB-DF125A9FCDB0}</Project>
|
||||
<Name>System.Net.Http.Formatting</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\System.Web.Http\System.Web.Http.csproj">
|
||||
<Project>{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440}</Project>
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.Net.Http;
|
|||
using System.Net.Http.Headers;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Hosting;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Http.WebHost.Properties;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.ComponentModel;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.WebHost;
|
||||
using System.Web.Http.WebHost.Routing;
|
||||
using System.Web.Routing;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Routing;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Web.Hosting;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Http.WebHost.Properties;
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Routing;
|
||||
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace System.Web.Http.WebHost.Routing
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace System.Web.Http.WebHost.Routing
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Http.Routing;
|
||||
using System.Web.Routing;
|
||||
|
||||
namespace System.Web.Http.WebHost.Routing
|
||||
|
|
|
@ -60,6 +60,18 @@
|
|||
<Compile Include="..\CommonAssemblyInfo.cs">
|
||||
<Link>Properties\CommonAssemblyInfo.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\Error.cs">
|
||||
<Link>Common\Error.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\HttpMethodHelper.cs">
|
||||
<Link>Common\HttpMethodHelper.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\TaskHelpers.cs">
|
||||
<Link>Common\TaskHelpers.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="..\Common\TaskHelpersExtensions.cs">
|
||||
<Link>Common\TaskHelpersExtensions.cs</Link>
|
||||
</Compile>
|
||||
<Compile Include="Routing\HostedHttpRouteCollection.cs" />
|
||||
<Compile Include="Routing\HostedHttpRoute.cs" />
|
||||
<Compile Include="Routing\HostedHttpRouteData.cs" />
|
||||
|
@ -90,6 +102,21 @@
|
|||
<Compile Include="RouteCollectionExtensions.cs" />
|
||||
<Compile Include="TaskWrapperAsyncResult.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="..\Common\CommonWebApiResources.Designer.cs">
|
||||
<Link>Properties\CommonWebApiResources.Designer.cs</Link>
|
||||
<AutoGen>True</AutoGen>
|
||||
<DesignTime>True</DesignTime>
|
||||
<DependentUpon>CommonWebApiResources.resx</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\Common\CommonWebApiResources.resx">
|
||||
<Link>Properties\CommonWebApiResources.resx</Link>
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>CommonWebApiResources.Designer.cs</LastGenOutput>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Properties\SRResources.resx">
|
||||
<Generator>ResXFileCodeGenerator</Generator>
|
||||
|
@ -97,10 +124,6 @@
|
|||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\System.Web.Http.Common\System.Web.Http.Common.csproj">
|
||||
<Project>{03A5E5F2-2E23-48F2-ABCC-6C41BAC9AC02}</Project>
|
||||
<Name>System.Web.Http.Common</Name>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\System.Web.Http\System.Web.Http.csproj">
|
||||
<Project>{DDC1CE0C-486E-4E35-BB3B-EAB61F8F9440}</Project>
|
||||
<Name>System.Web.Http</Name>
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.WebHost
|
||||
{
|
||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.ObjectModel;
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
|
||||
namespace System.Web.Http
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.Linq;
|
|||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Dispatcher;
|
||||
using System.Web.Http.Filters;
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.Linq;
|
|||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Security.Principal;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Filters;
|
||||
|
||||
|
|
|
@ -3,7 +3,6 @@ using System.Diagnostics.Contracts;
|
|||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.Controllers
|
||||
{
|
||||
|
|
|
@ -7,7 +7,6 @@ using System.Net.Http;
|
|||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Threading;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Internal;
|
||||
using System.Web.Http.Properties;
|
||||
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.ModelBinding;
|
||||
|
||||
namespace System.Web.Http.Controllers
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Metadata;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using System.Web.Http.Properties;
|
||||
|
|
|
@ -5,7 +5,6 @@ using System.Diagnostics.CodeAnalysis;
|
|||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Filters;
|
||||
|
||||
namespace System.Web.Http.Controllers
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Net.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Routing;
|
||||
|
||||
namespace System.Web.Http.Controllers
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.Collections.ObjectModel;
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Dispatcher;
|
||||
using System.Web.Http.Filters;
|
||||
using System.Web.Http.Internal;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Internal;
|
||||
using System.Web.Http.ModelBinding;
|
||||
|
||||
|
|
|
@ -7,7 +7,6 @@ using System.Linq.Expressions;
|
|||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Filters;
|
||||
using System.Web.Http.Internal;
|
||||
using System.Web.Http.Properties;
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
using System.Collections.ObjectModel;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Internal;
|
||||
|
||||
namespace System.Web.Http.Controllers
|
||||
|
|
|
@ -2,7 +2,6 @@ using System.Collections.Generic;
|
|||
using System.ComponentModel;
|
||||
using System.Linq;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Description;
|
||||
using System.Web.Http.Dispatcher;
|
||||
|
|
|
@ -6,7 +6,6 @@ using System.Linq;
|
|||
using System.Net.Http;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Text.RegularExpressions;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Dispatcher;
|
||||
using System.Web.Http.Internal;
|
||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.Generic;
|
|||
using System.ComponentModel;
|
||||
using System.Diagnostics.Contracts;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Properties;
|
||||
|
||||
namespace System.Web.Http
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Threading;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Internal;
|
||||
using System.Web.Http.Properties;
|
||||
|
|
|
@ -5,7 +5,6 @@ using System.Diagnostics.Contracts;
|
|||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Properties;
|
||||
using System.Web.Http.Routing;
|
||||
|
|
|
@ -5,7 +5,6 @@ using System.Net;
|
|||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Hosting;
|
||||
using System.Web.Http.Properties;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Internal;
|
||||
|
||||
namespace System.Web.Http.Dispatcher
|
||||
|
|
|
@ -4,7 +4,6 @@ using System.Diagnostics.CodeAnalysis;
|
|||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.Dispatcher
|
||||
{
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
|
||||
namespace System.Web.Http.Filters
|
||||
|
|
|
@ -3,7 +3,6 @@ using System.Diagnostics.Contracts;
|
|||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Properties;
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@
|
|||
using System.Net.Http;
|
||||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
|
||||
namespace System.Web.Http.Filters
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
|
||||
namespace System.Web.Http.Filters
|
||||
|
|
|
@ -5,7 +5,6 @@ using System.Linq;
|
|||
using System.Net.Http;
|
||||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Internal;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Internal;
|
||||
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.Filters
|
||||
{
|
||||
|
|
|
@ -1,6 +1,4 @@
|
|||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.Filters
|
||||
namespace System.Web.Http.Filters
|
||||
{
|
||||
public sealed class FilterInfo
|
||||
{
|
||||
|
|
|
@ -1,5 +1,4 @@
|
|||
using System.Net.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
|
||||
namespace System.Web.Http.Filters
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http.Common;
|
||||
|
||||
namespace System.Web.Http.Filters
|
||||
{
|
||||
|
|
|
@ -3,7 +3,6 @@ using System.Diagnostics.Contracts;
|
|||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Controllers;
|
||||
using System.Web.Http.Properties;
|
||||
using System.Web.Http.Query;
|
||||
|
|
|
@ -1,6 +1,5 @@
|
|||
using System.Collections.Generic;
|
||||
using System.Net.Http;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Properties;
|
||||
|
||||
namespace System.Web.Http.Hosting
|
||||
|
|
|
@ -3,7 +3,6 @@ using System.Collections.ObjectModel;
|
|||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Net.Http;
|
||||
using System.Net.Http.Formatting;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Filters;
|
||||
using System.Web.Http.ModelBinding;
|
||||
using System.Web.Http.Services;
|
||||
|
|
|
@ -7,7 +7,6 @@ using System.Net.Http.Formatting;
|
|||
using System.Net.Http.Headers;
|
||||
using System.Security.Principal;
|
||||
using System.Threading;
|
||||
using System.Web.Http.Common;
|
||||
using System.Web.Http.Hosting;
|
||||
using System.Web.Http.Properties;
|
||||
using System.Web.Http.Routing;
|
||||
|
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче