Example #1
0
        async Task ExecuteLoadItemsCommand()
        {
            IsBusy = true;

            try
            {
                var result = await CoinsService.GetAllCoinsAsync();

                foreach (var x in result)
                {
                    Coins.Add(new CoinsModel.Value
                    {
                        nomeFormatado = x.nomeFormatado,
                        tipoMoeda     = x.tipoMoeda,
                        simbolo       = x.simbolo
                    });
                }
                LoadSelectedCoins();
            }
            catch (Exception)
            {
                throw;
            }
            finally
            {
                IsBusy = false;
            }
        }
Example #2
0
 public static async Task <UserCoins> GetCoins(this SocketUser user)
 => await CoinsService.GetUserCoins("discord", Convert.ToInt64(user.Id));
Example #3
0
 public static async Task <UserCoins> AddCoins(this SocketUser user, long count)
 => await CoinsService.AddUserCoins("discord", Convert.ToInt64(user.Id), count);
Example #4
0
 public static async Task <UserCoins> RemoveCoins(this SocketUser user, long count, bool disableFree = false)
 => await CoinsService.RemoveUserCoins("discord", Convert.ToInt64(user.Id), count, disableFree);
Example #5
0
 public CoinsServiceTests(DbContextFixture fixture)
 {
     coinRepository = new CoinRepository(fixture.Context);
     coinsService   = new CoinsService(coinRepository);
 }