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"); }
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(); }
public Task CreateStoreAsync(Store store, CancellationToken ct = default) { return(_httpRequestService.PostAsync("stores", store, ct)); }
public Task CreatePromotionAsync(Promotion promotion, CancellationToken ct = default) { return(_httpRequestService.PostAsync("promotions", promotion, ct)); }