Beispiel #1
0
        public IActionResult Get(string key)
        {
            if (String.IsNullOrEmpty(key))
            {
                return(StatusCode(StatusCodes.Status400BadRequest));
            }

            object value = _settingsManager.GetSetting(key);

            if (value == null)
            {
                return(NotFound(String.Format(Resources.SettingDoesNotExist, key)));
            }

            return(Ok(value));
        }
Beispiel #2
0
        public HttpResponseMessage Get(string key)
        {
            if (String.IsNullOrEmpty(key))
            {
                return(Request.CreateResponse(HttpStatusCode.BadRequest));
            }

            object value = _settingsManager.GetSetting(key);

            if (value == null)
            {
                return(Request.CreateErrorResponse(HttpStatusCode.NotFound, String.Format(Resources.SettingDoesNotExist, key)));
            }

            return(Request.CreateResponse(HttpStatusCode.OK, value));
        }