public void ToController <T>() where T : IRenderingController { var routeData = new RouteInfo { Method = this.HttpMethod, Host = this.Domain, Path = this.Path, Type = typeof(T) }; var func = this.Create <T>((x, y, z) => x.Execute(y, z)); var tree = new ExpressiveRouteValidator <T>().ValidateExpression(func); routeData.Expression = func; routeData.ExpressionTree = tree; routeData.WrapperExpression = (x, y, z) => func.Compile().Invoke((T)x, y, z); this.Router.Register(routeData); }
// Please be careful when calling this method public void Register(RouteInfo routeInfo) { this.RenderingControllersRouteData.AddLast(routeInfo); }