public ActionResult <bool> GenericPut(string typename, int id, [FromBody] JObject post) { Type type = null; try { type = GetTypeCaseInsensitive($"DatabaseWebService.DatabaseObjects.{typename}"); if (type == null) { throw new Exception($"The requested datatype {typename} doesnt exist."); } DbSelector.Update(id, post.ToObject(type)); return(true); } catch (TargetException) { var text = type.GetProperties().Aggregate("Supplied a faulty object to the Server. The expected Structure is:\n", (current, prop) => current + $"{prop.Name} : {prop.PropertyType.Name}\n"); throw new Exception(text); } }