コード例 #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));
 }