public ActionResult <string> PostToggleDevOptionsRaiseCommandFailed( [FromServices] DevOptionsConfigurationProvider provider , [FromServices] IWebHostEnvironment environment) { if (!environment.IsDevelopment()) { return(BadRequest("only in development enviroment")); } provider.SetOption(x => x.RaiseCommandFailed = !x.RaiseCommandFailed); return($"RaiseCommandFailed: {provider.DevOptions.RaiseCommandFailed}"); }
public ActionResult <string> PostToggleDevOptionsPostWithBadRequest( [FromServices] DevOptionsConfigurationProvider provider , [FromServices] IWebHostEnvironment environment ) { if (!environment.IsDevelopment()) { return(BadRequest("only in development enviroment")); } provider.SetOption(x => x.PostWithBadRequest = !x.PostWithBadRequest); return($"PostWithBadRequest: {provider.DevOptions.PostWithBadRequest}"); }