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)); }
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)); }