ServiceRoute.cs 581 B

12345678910111213141516171819202122
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. namespace ServerLib
  7. {
  8. public class ServiceRoute
  9. {
  10. public RouteMethod Method { get; private set; }
  11. public string RoutePath { get; private set; }
  12. public static ServiceRoute Parse(HttpRequest request)
  13. {
  14. var route = new ServiceRoute();
  15. route.Method = (RouteMethod)Enum.Parse(typeof(RouteMethod), request.Method);
  16. route.RoutePath = request.URL;
  17. return route;
  18. }
  19. }
  20. }