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.

HelpController.cs 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Web.Http;
  3. using System.Web.Mvc;
  4. using Authentication_test.Areas.HelpPage.Models;
  5. namespace Authentication_test.Areas.HelpPage.Controllers
  6. {
  7. /// <summary>
  8. /// The controller that will handle requests for the help page.
  9. /// </summary>
  10. public class HelpController : Controller
  11. {
  12. public HelpController()
  13. : this(GlobalConfiguration.Configuration)
  14. {
  15. }
  16. public HelpController(HttpConfiguration config)
  17. {
  18. Configuration = config;
  19. }
  20. public HttpConfiguration Configuration { get; private set; }
  21. public ActionResult Index()
  22. {
  23. ViewBag.DocumentationProvider = Configuration.Services.GetDocumentationProvider();
  24. return View(Configuration.Services.GetApiExplorer().ApiDescriptions);
  25. }
  26. public ActionResult Api(string apiId)
  27. {
  28. if (!String.IsNullOrEmpty(apiId))
  29. {
  30. HelpPageApiModel apiModel = Configuration.GetHelpPageApiModel(apiId);
  31. if (apiModel != null)
  32. {
  33. return View(apiModel);
  34. }
  35. }
  36. return View("Error");
  37. }
  38. }
  39. }