Ejemplo n.º 1
0
 public async Task NextExercise(string guid, string userBind)
 {
     if (decks.getByGuid(guid).cardDeck.Count <= 1)
     {
         decks.increaseScore(userBind);
         await Clients.Caller.SendAsync("Finished");
     }
     else
     {
         Deck currentDeck = decks.getByGuid(guid);
         currentDeck.cardDeck.Remove(currentDeck.cardDeck[0]);
         decks.update(currentDeck);
         Card newCurrentCard = decks.getByGuid(guid).cardDeck[0];
         await Clients.Caller.SendAsync("newExercise", newCurrentCard.name, newCurrentCard.muscleGroup, newCurrentCard.description);
     }
 }
Ejemplo n.º 2
0
 public void OnGet(string DeckGuid)
 {
     currentUser = db.Users.FirstOrDefault(r => r.Email == User.Identity.Name);
     currentDeck = decks.getByGuid(DeckGuid);
 }