public async Task <TResult> GetAsync <TController, TResult>(object resource, HttpActionDelegate <object, TResult> callback) { var response = await this.GetAsync <TController>(resource); var results = callback(response, resource); return(results); }
public static Task <TResult> Created <TResource, TResult>( Func <HttpActionDelegate <TResource, TResult>, Task <TResult> > action, HttpActionDelegate <TResource, TResult> callback) { return(action( (response, resource) => { StatusCodeIs(HttpStatusCode.Created, response); return callback(response, resource); })); }
public HttpActionResult(HttpActionDelegate callback) { this.callback = () => callback(); }
public IHttpActionResult Delete([FromBody] Resources.RoleQuery role) { HttpActionDelegate callback = () => role.DeleteAsync(this.Request, this.Url); return(callback.ToActionResult()); }
public static HttpActionResult ActionResult(this object discard, HttpActionDelegate callback) { return(new HttpActionResult(callback)); }
public static IHttpActionResult ActionResult(this ApiController controller, HttpActionDelegate action) { return(action.ToActionResult()); }
public static IHttpActionResult ToActionResult(this HttpActionDelegate action) { return(new HttpActionResult(action)); }