public IHttpActionResult UpdateWidget([FromBody] UserWidgetDTO[] widgets) { widgetManager = new WidgetManager(); foreach (UserWidgetDTO widget in widgets) { if (widget == null) { return(BadRequest("No widget given")); } if (widgetManager.GetWidget(widget.WidgetId) == null) { return(NotFound()); } widgetManager.ChangeWidgetDetails(widget.WidgetId, widget.RowNumber, widget.ColumnNumber, widget.ItemIds.ToList(), widget.RowSpan, widget.ColumnSpan, widget.GraphType); } return(StatusCode(HttpStatusCode.NoContent)); }