Ejemplo n.º 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()));
        }
Ejemplo n.º 2
0
 public Task <User> CreateUserGroupAsync(int userId, int groupId)
 {
     return(_clientFactory.CreateClient().PostUserGroupAsync(new UserGroup {
         UserId = userId, GroupId = groupId
     }));
 }
Ejemplo n.º 3
0
 public Task <Report> CreateReportAsync(AddReportModel report)
 {
     return(_clientFactory.CreateClient().PostAsync(report));
 }
Ejemplo n.º 4
0
 public Task <Category> CreateCategoryAsync(Category category)
 {
     return(_clientFactory.CreateClient().PostAsync(category));
 }
Ejemplo n.º 5
0
 public Task <ShoppingList> CreateShoppingListAsync(ShoppingList shoppingList, int groupId)
 {
     return(_clientFactory.CreateClient().PostAsync(shoppingList, groupId));
 }
Ejemplo n.º 6
0
 public Task <Expense> CreateExpenseAsync(AddExpenseModel expense)
 {
     return(_clientFactory.CreateClient().PostAsync(expense));
 }
Ejemplo n.º 7
0
 public Task <Group> CreateGroupAsync(Group group)
 {
     return(_clientFactory.CreateClient().PostAsync(group));
 }