You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

HelpPageApiModel.cshtml 1.4KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. @using System.Web.Http
  2. @using WebAPiUtils_test.Areas.HelpPage.Models
  3. @model HelpPageApiModel
  4. @{
  5. var description = Model.ApiDescription;
  6. bool hasParameters = description.ParameterDescriptions.Count > 0;
  7. bool hasRequestSamples = Model.SampleRequests.Count > 0;
  8. bool hasResponseSamples = Model.SampleResponses.Count > 0;
  9. }
  10. <h1>@description.HttpMethod.Method @description.RelativePath</h1>
  11. <div>
  12. @if (description.Documentation != null)
  13. {
  14. <p>@description.Documentation</p>
  15. }
  16. else
  17. {
  18. <p>No documentation available.</p>
  19. }
  20. @if (hasParameters || hasRequestSamples)
  21. {
  22. <h2>Request Information</h2>
  23. if (hasParameters)
  24. {
  25. <h3>Parameters</h3>
  26. @Html.DisplayFor(apiModel => apiModel.ApiDescription.ParameterDescriptions, "Parameters")
  27. }
  28. if (hasRequestSamples)
  29. {
  30. <h3>Request body formats</h3>
  31. @Html.DisplayFor(apiModel => apiModel.SampleRequests, "Samples")
  32. }
  33. }
  34. @if (hasResponseSamples)
  35. {
  36. <h2>Response Information</h2>
  37. if (description.ResponseDescription.Documentation != null)
  38. {
  39. <p>@description.ResponseDescription.Documentation</p>
  40. }
  41. else
  42. {
  43. <p>No documentation available.</p>
  44. }
  45. <h3>Response body formats</h3>
  46. @Html.DisplayFor(apiModel => apiModel.SampleResponses, "Samples")
  47. }
  48. </div>