The next generation of the Teknik Services. Written in ASP.NET. Fork for blog tags.
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.

StreamAreaRegistration.cs 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System.Collections.Generic;
  2. using System.Web.Mvc;
  3. using Teknik.Configuration;
  4. namespace Teknik.Areas.Stream
  5. {
  6. public class StreamAreaRegistration : AreaRegistration
  7. {
  8. public override string AreaName
  9. {
  10. get
  11. {
  12. return "Stream";
  13. }
  14. }
  15. public override void RegisterArea(AreaRegistrationContext context)
  16. {
  17. Config config = Config.Load();
  18. context.MapSubdomainRoute(
  19. "Stream.Index", // Route name
  20. new List<string>() { "stream" }, // Subdomains
  21. new List<string>() { config.Host }, // domains
  22. "", // URL with parameters
  23. new { controller = "Stream", action = "Index" }, // Parameter defaults
  24. new[] { typeof(Controllers.StreamController).Namespace }
  25. );
  26. context.MapSubdomainRoute(
  27. "Stream.View", // Route name
  28. new List<string>() { "stream" }, // Subdomains
  29. new List<string>() { config.Host }, // domains
  30. "Stream/{id}", // URL with parameters
  31. new { controller = "Stream", action = "ViewStream" }, // Parameter defaults
  32. new[] { typeof(Controllers.StreamController).Namespace }
  33. );
  34. }
  35. }
  36. }