Example #1
0
        public async Task <DatabaseModel.Staff> Find(string steamId)
        {
            var query = _staffQueries.GetStaffFromSteamId(steamId);
            var res   = await _databaseConnection.ExecuteSqlQueryAsync(query);

            return(await res.GetSingleAsync <DatabaseModel.Staff>());
        }
Example #2
0
        public async Task <List <DatabaseModel.Level> > GetAll()
        {
            var query = _levelQueries.GetAll();
            var res   = await _databaseConnection.ExecuteSqlQueryAsync(query);

            return(await res.GetListAsync <DatabaseModel.Level>());
        }
        public async Task <DatabaseModel.Settings> GetSettingsAsync()
        {
            var query = new SqlQuery("SELECT * FROM [Settings] WHERE Id = 1", new Dictionary <string, object>());
            var res   = await _databaseConnection.ExecuteSqlQueryAsync(query);

            return(await res.GetSingleAsync <DatabaseModel.Settings>());
        }
Example #4
0
        public async Task <DatabaseModel.Bot> FindAsync(string steamId)
        {
            var query = _botQueries.GetFromSteamId(steamId);

            using (var sqlResult = await _databaseConnection.ExecuteSqlQueryAsync(query))
            {
                return(await sqlResult.GetSingleAsync <DatabaseModel.Bot>());
            }
        }
Example #5
0
        public async Task <List <DatabaseModel.ItemDescription> > GetAll()
        {
            var query = _itemDescriptionQueries.GetAll();

            using (var sqlResult = await _databaseConnection.ExecuteSqlQueryAsync(query))
            {
                return(await sqlResult.GetListAsync <DatabaseModel.ItemDescription>());
            }
        }
        public async Task <List <DatabaseModel.ItemBetted> > FindAsync(DatabaseModel.Bet bet)
        {
            var query = _itemBetQueries.GetItemBetsOnBet(bet.Id);

            using (var sqlResult = await _databaseConnection.ExecuteSqlQueryAsync(query))
            {
                return(await sqlResult.GetListAsync <DatabaseModel.ItemBetted>());
            }
        }
Example #7
0
        public async Task <DatabaseModel.User> FindAsync(string steamId)
        {
            var query = _userQueries.GetUserWithSteamId(steamId);

            using (var sqlRes = await _databaseConnection.ExecuteSqlQueryAsync(query))
            {
                var user = await sqlRes.GetSingleAsync <DatabaseModel.User>();

                return(user);
            }
        }
Example #8
0
        public async Task <List <DatabaseModel.OfferTransaction> > FindAsync(DatabaseModel.User user)
        {
            var query = _offerTransationQueries.GetFromUserId(user.Id);

            using (var sqlRes = await _databaseConnection.ExecuteSqlQueryAsync(query))
            {
                var offerTransaction = await sqlRes.GetListAsync <DatabaseModel.OfferTransaction>();

                return(offerTransaction);
            }
        }
Example #9
0
        public async Task <List <DatabaseModel.ItemInOfferTransaction> > FindAsync(List <DatabaseModel.OfferTransaction> offerTransactions)
        {
            if (offerTransactions.Count == 0)
            {
                return(new List <DatabaseModel.ItemInOfferTransaction>());
            }

            var ids   = offerTransactions.Select(offerTransaction => offerTransaction.Id).ToList();
            var query = _itemInOfferTransactionQueries.GetFromTransactionsIds(ids);

            using (var sqlRes = await _databaseConnection.ExecuteSqlQueryAsync(query))
            {
                var items = await sqlRes.GetListAsync <DatabaseModel.ItemInOfferTransaction>();

                return(items);
            }
        }
        public async Task <DatabaseModel.RakeItem> FindAsync(int id)
        {
            var query = _rakeItemQueries.GetFromId(id);

            using (var sqlResult = await _databaseConnection.ExecuteSqlQueryAsync(query))
            {
                return(await sqlResult.GetSingleAsync <DatabaseModel.RakeItem>());
            }
        }
Example #11
0
        public async Task <List <DatabaseModel.Match> > FindRangeAsync(int id, int i)
        {
            var query = _matchQueries.FindRange(id, i);
            var res   = await _databaseConnection.ExecuteSqlQueryAsync(query);

            return(await res.GetListAsync <DatabaseModel.Match>());
        }
Example #12
0
        public async Task <List <DatabaseModel.Bet> > FindAsync(DatabaseModel.User user)
        {
            var query = _betQueries.GetAllBetsFromUser(user.Id);

            using (var sqlResult = await _databaseConnection.ExecuteSqlQueryAsync(query))
            {
                return(await sqlResult.GetListAsync <DatabaseModel.Bet>());
            }
        }