public object PatchMail(JsonPatchDocument patchedMail, Guid id) { if (patchedMail == null) { return(BadRequest()); } var mail = mailingRepository.Retrieve(id); if (mail == null) { return(NotFound()); } patchedMail.ApplyTo(mail); mailingService.Save(id, mail); return(Ok(mail)); }