示例#1
0
        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}");
        }
示例#2
0
        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}");
        }