Exemple #1
0
        private static void HardcodeGet()
        {
            AerospikeQueryClient c = new AerospikeQueryClient();

            try
            {
                Console.WriteLine(c.GetUserInfo(1).Login);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
            try
            {
                Console.WriteLine(c.GetCollectionsByUserId(1).Count);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }

            try
            {
                Console.WriteLine(c.GetCardsByUserId(1)[0].FrontSide);
            }
            catch (Exception e)
            {
                Console.WriteLine(e.Message);
            }
        }
Exemple #2
0
 public List <Quizleç.Models.Collection> GetCollectionsByUserId(int id)
 {
     try
     {
         using var client = new AerospikeQueryClient();
         return(client.GetCollectionsByUserId(id));
     }
     catch (DatabaseException e)
     {
         throw new GraphQlException(e.Message);
     }
 }
Exemple #3
0
 public UserWithCollections GetUser(int id)
 {
     try
     {
         using var client = new AerospikeQueryClient();
         var user        = client.GetUserInfo(id);
         var collections = client.GetCollectionsByUserId(id);
         var res         = new UserWithCollections()
         {
             Id          = user.Id, Login = user.Login, Email = user.Email,
             Collections = collections, CollectionsCount = collections.Count
         };
         return(res);
     }
     catch (DatabaseException e)
     {
         throw new GraphQlException(e.Message);
     }
 }