// PUT api/training/5 - update card public void Put(string id, [FromBody]byte answer) { var currentUser = new UserService().FindByName(User.Identity.Name); var cardFromService = new CardService().GetCardByID(id); if (cardFromService == null) { return; } var score = Score.None; if (answer > 2 && answer < 6) { score = (Score)answer; } Algorithm.GetUpdatedCard(cardFromService, score); var drillService = new DrillService(); drillService.UpdateCard(cardFromService, currentUser.Id); }