예제 #1
0
        public async Task <IActionResult> Post(string key, string value)
        {
            if (value == null)
            {
                ModelState.AddModelError("value", "Required");
                return(BadRequest(ModelState));
            }
            var result = await _keyValueService.SetValueAsync(key, value);

            if (result.Item1)
            {
                return(Ok(result.Item2));
            }
            else
            {
                return(BadRequest());
            }
        }