/// <summary> /// Adds the given webservice resource to the layout, accessible using /// the specified path. /// </summary> /// <typeparam name="T">The type of the resource to be added</typeparam> /// <param name="path">The path the resource should be available at</param> public static LayoutBuilder Add <T>(this LayoutBuilder layout, string path) where T : new() { return(layout.Add(path, Resource.From <T>())); }
/// <summary> /// Adds the given webservice resource to the layout, accessible using /// the specified path. /// </summary> /// <param name="path">The path the resource should be available at</param> /// <param name="instance">The webservice resource instance</param> public static LayoutBuilder Add(this LayoutBuilder layout, string path, object instance) { return(layout.Add(path, Resource.From(instance))); }
/// <summary> /// Causes all requests to the specified path to be handled by the /// given controller class. /// </summary> /// <typeparam name="T">The type of the controller used to handle requests</typeparam> /// <param name="builder">The layout the controller should be added to</param> /// <param name="path">The path that should be handled by the controller</param> public static LayoutBuilder AddController <T>(this LayoutBuilder builder, string path) where T : new() { builder.Add(path, Controller.From <T>()); return(builder); }