Ejemplo n.º 1
0
        public async Task LoginAsync(string username, string password, CancellationToken ct = default(CancellationToken))
        {
            var user = new User()
            {
                Username = username,
                Password = password
            };

            var result = await _httpRequestService.PostAsync <User>("Users/Login", user, ct);

            Debug.WriteLine("Login successful");
        }
Ejemplo n.º 2
0
        public async Task GetJson()
        {
            try
            {
                var result = await _httpRequestService.GetJsonAsync();

                await _fileService.CreateFile(result);

                var decrypted = _decryptService.Decrypt(result);
                var hash      = _securityService.CreateHash(decrypted);

                await _fileService.UpdateFile(decrypted, hash);

                await _httpRequestService.PostAsync();
            }
            catch (Exception ex)
            {
                Console.WriteLine(ex.Message);
                throw;
            }
            Console.ReadKey();
        }
Ejemplo n.º 3
0
 public Task CreateStoreAsync(Store store, CancellationToken ct = default)
 {
     return(_httpRequestService.PostAsync("stores", store, ct));
 }
Ejemplo n.º 4
0
 public Task CreatePromotionAsync(Promotion promotion, CancellationToken ct = default)
 {
     return(_httpRequestService.PostAsync("promotions", promotion, ct));
 }