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.

Samples.cshtml 899B

123456789101112131415161718192021222324252627282930
  1. @using System.Net.Http.Headers
  2. @model Dictionary<MediaTypeHeaderValue, object>
  3. @{
  4. // Group the samples into a single tab if they are the same.
  5. Dictionary<string, object> samples = Model.GroupBy(pair => pair.Value).ToDictionary(
  6. pair => String.Join(", ", pair.Select(m => m.Key.ToString()).ToArray()),
  7. pair => pair.Key);
  8. var mediaTypes = samples.Keys;
  9. }
  10. <div>
  11. @foreach (var mediaType in mediaTypes)
  12. {
  13. <h4 class="sample-header">@mediaType</h4>
  14. <div class="sample-content">
  15. <span><b>Sample:</b></span>
  16. @{
  17. var sample = samples[mediaType];
  18. if (sample == null)
  19. {
  20. <p>Sample not available.</p>
  21. }
  22. else
  23. {
  24. @Html.DisplayFor(s => sample);
  25. }
  26. }
  27. </div>
  28. }
  29. </div>