Ejemplo n.º 1
0
        public IHttpActionResult PutName(int id, string title)
        {
            widgetManager = new WidgetManager();

            if (widgetManager.GetWidget(id) == null)
            {
                return(NotFound());
            }
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            widgetManager.ChangeWidgetTitle(id, title);
            return(StatusCode(HttpStatusCode.NoContent));
        }