public override void Configure(IConfigureRoutingConventions conventions) { conventions.Always() .Modify((route, info) => { if (info.ActionCall.IsGet()) { route.ConstrainToGet(); return; } if (info.ActionCall.IsPost()) { route.ConstrainToPost(); return; } #if WEBAPI if (info.ActionCall.IsPut()) { route.Constrain(HttpMethod.Put); return; } if (info.ActionCall.IsDelete()) { route.Constrain(HttpMethod.Delete); return; } #endif }); }
public override void Configure(IConfigureRoutingConventions conventions) { conventions.Always() .Modify((route, info) => { if (info.ActionCall.IsGet()) { route.ConstrainToGet(); return; } if (info.ActionCall.IsPost()) { route.ConstrainToPost(); return; } #if WEBAPI if (info.ActionCall.IsPut()) { route.Constrain(HttpMethod.Put); return; } if (info.ActionCall.IsDelete()) { route.Constrain(HttpMethod.Delete); return; } #endif }); }
public static IConfigureAction Always(this IConfigureRoutingConventions cfg) { return(cfg.If(d => true)); }
public abstract void Configure(IConfigureRoutingConventions conventions);