public Score ApplyPatch(Score currentScore, ScorePatchDTO scorePatch) { currentScore.ImageScore = scorePatch.ImageScore; _scores.Update(currentScore); SaveChanges(); return(currentScore); }
public ActionResult <Score> PatchScore(int id, ScorePatchDTO scorePatch) { if (scorePatch == null) { return(BadRequest("please insert information")); } if (_scoreRepository.GetById(id) == null) { return(NotFound()); } Score currentScore = _scoreRepository.GetById(id); return(_scoreRepository.ApplyPatch(currentScore, scorePatch)); }