Parameters.cshtml
1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
@using System.Collections.ObjectModel
@using System.Web.Http.Description
@using System.Threading
@model Collection<ApiParameterDescription>
<table class="help-page-table">
<thead>
<tr><th>Name</th><th>Description</th><th>Additional information</th></tr>
</thead>
<tbody>
@foreach (ApiParameterDescription parameter in Model)
{
string parameterDocumentation = parameter.Documentation != null ?
parameter.Documentation :
"No documentation available.";
// Don't show CancellationToken because it's a special parameter
if (parameter.ParameterDescriptor == null ||
(parameter.ParameterDescriptor != null &&
!typeof(CancellationToken).IsAssignableFrom(parameter.ParameterDescriptor.ParameterType)))
{
<tr>
<td class="parameter-name"><b>@parameter.Name</b></td>
<td class="parameter-documentation"><pre>@parameterDocumentation</pre></td>
<td class="parameter-source">
@switch (parameter.Source)
{
case ApiParameterSource.FromBody:
<p>Define this parameter in the request <b>body</b>.</p>
break;
case ApiParameterSource.FromUri:
<p>Define this parameter in the request <b>URI</b>.</p>
break;
case ApiParameterSource.Unknown:
default:
<p>None.</p>
break;
}
</td>
</tr>
}
}
</tbody>
</table>