/WCFWebApi/src/Microsoft.ApplicationServer.Http/Microsoft/ApplicationServer/Http/Description/HttpParameterExtensionMethods.cs
C# | 32 lines | 16 code | 3 blank | 13 comment | 2 complexity | 8431cccbc1876cfd8e18cf92efaa1072 MD5 | raw file
Possible License(s): CC-BY-SA-3.0, Apache-2.0
- // <copyright>
- // Copyright (c) Microsoft Corporation. All rights reserved.
- // </copyright>
-
- namespace Microsoft.ApplicationServer.Http.Description
- {
- using System.ServiceModel.Description;
- using Microsoft.Server.Common;
-
- /// <summary>
- /// Provides extension methods for <see cref="MessagePartDescription"/>
- /// to translate to <see cref="HttpParameter"/>.
- /// </summary>
- public static class HttpParameterExtensionMethods
- {
- /// <summary>
- /// Creates a new <see cref="HttpParameter"/> instance from the given
- /// <see cref="MessagePartDescription"/>.
- /// </summary>
- /// <param name="description">The <see cref="MessagePartDescription"/> to use.</param>
- /// <returns>A new <see cref="HttpParameter"/> instance.</returns>
- public static HttpParameter ToHttpParameter(this MessagePartDescription description)
- {
- if (description == null)
- {
- throw Fx.Exception.ArgumentNull("description");
- }
-
- return new HttpParameter(description);
- }
- }
- }