예제 #1
0
        public async Task <UserToken> AuthenticateUserAsync(string username, string password)
        {
            var response = await _clientFactory.CreateClient().LoginAsync(new LoginModel {
                Name = username, Password = password
            });

            //var result = await response.Stream.ReadAsStringAsync();
            return(JsonConvert.DeserializeObject <UserToken>(response.ToString()));
        }
예제 #2
0
 public Task <User> CreateUserGroupAsync(int userId, int groupId)
 {
     return(_clientFactory.CreateClient().PostUserGroupAsync(new UserGroup {
         UserId = userId, GroupId = groupId
     }));
 }
예제 #3
0
 public Task <Report> CreateReportAsync(AddReportModel report)
 {
     return(_clientFactory.CreateClient().PostAsync(report));
 }
예제 #4
0
 public Task <Category> CreateCategoryAsync(Category category)
 {
     return(_clientFactory.CreateClient().PostAsync(category));
 }
예제 #5
0
 public Task <ShoppingList> CreateShoppingListAsync(ShoppingList shoppingList, int groupId)
 {
     return(_clientFactory.CreateClient().PostAsync(shoppingList, groupId));
 }
예제 #6
0
 public Task <Expense> CreateExpenseAsync(AddExpenseModel expense)
 {
     return(_clientFactory.CreateClient().PostAsync(expense));
 }
예제 #7
0
 public Task <Group> CreateGroupAsync(Group group)
 {
     return(_clientFactory.CreateClient().PostAsync(group));
 }