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); } }
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); } }