Ejemplo n.º 1
0
        public async Task <IReadOnlyList <GroupedTransaction> > GetGroupedByCategory()
        {
            User       user   = new User();
            HttpClient client = new HttpClient();

            var req = await client.GetAsync("https://localhost:5001/users/parser");

            Task <string> c = req.Content.ReadAsStringAsync();

            var res = JsonConvert.DeserializeObject <List <User> >(c.Result);

            foreach (var g in res)
            {
                if (g.Logged == true)
                {
                    user = new User()
                    {
                        Id        = g.Id,
                        Gmail     = g.Gmail,
                        Card      = g.Card,
                        Cash      = g.Cash,
                        FullName  = g.FullName,
                        UserImage = g.UserImage,
                        Logged    = true,
                        Password  = g.Password
                    };
                }
            }
            return(await _transactionsRepository.GetAmountSpentPerCategory(user.Id));
        }
Ejemplo n.º 2
0
 public async Task <IReadOnlyList <GroupedTransaction> > GetGroupedByCategory()
 {
     return(await _transactionsRepository.GetAmountSpentPerCategory(Domain.Constants.Constants.TestUserId));
 }