Exemple #1
0
 public List <Quizleç.Models.Card> GetCardsByCollectionId(int id)
 {
     try
     {
         using var client = new AerospikeQueryClient();
         return(client.GetCardsByCollectionId(id));
     }
     catch (DatabaseException e)
     {
         throw new GraphQlException(e.Message);
     }
 }
Exemple #2
0
 public CollectionWithCards GetCollection(int id)
 {
     try
     {
         using var client = new AerospikeQueryClient();
         var collection = client.GetCollectionInfo(id);
         var cards      = client.GetCardsByCollectionId(id);
         var res        = new CollectionWithCards()
         {
             Id    = collection.Id, Name = collection.Name, Description = collection.Description,
             Cards = cards, CardsCount = cards.Count
         };
         return(res);
     }
     catch (DatabaseException e)
     {
         throw new GraphQlException(e.Message);
     }
 }