public async Task <ActionResult <ArtistDTO> > Put(int id, [FromBody] JObject model) { var valueProvider = new ObjectSourceValueProvider(model); var existing = context.Artists.FirstOrDefault(p => p.Id == id); if (existing != null && ModelState.IsValid && await TryUpdateModelAsync(existing, "", valueProvider)) { this.context.SaveChanges(); return(Get(id)); } if (existing == null) { ModelState.AddModelError("id", "Invalid client ID"); } return(BadRequest(ModelState)); }
private Task <bool> TryUpdateModelAsync(Song existing, string v, ObjectSourceValueProvider valueProvider) { throw new NotImplementedException(); }