PageRenderTime 35ms CodeModel.GetById 10ms RepoModel.GetById 0ms app.codeStats 0ms

/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
  1. // <copyright>
  2. // Copyright (c) Microsoft Corporation. All rights reserved.
  3. // </copyright>
  4. namespace Microsoft.ApplicationServer.Http.Description
  5. {
  6. using System.ServiceModel.Description;
  7. using Microsoft.Server.Common;
  8. /// <summary>
  9. /// Provides extension methods for <see cref="MessagePartDescription"/>
  10. /// to translate to <see cref="HttpParameter"/>.
  11. /// </summary>
  12. public static class HttpParameterExtensionMethods
  13. {
  14. /// <summary>
  15. /// Creates a new <see cref="HttpParameter"/> instance from the given
  16. /// <see cref="MessagePartDescription"/>.
  17. /// </summary>
  18. /// <param name="description">The <see cref="MessagePartDescription"/> to use.</param>
  19. /// <returns>A new <see cref="HttpParameter"/> instance.</returns>
  20. public static HttpParameter ToHttpParameter(this MessagePartDescription description)
  21. {
  22. if (description == null)
  23. {
  24. throw Fx.Exception.ArgumentNull("description");
  25. }
  26. return new HttpParameter(description);
  27. }
  28. }
  29. }