Exemplo n.º 1
0
        public Bets DapperGetBetById()
        {
            using (var conn = ConnectionFactory.GetConnection())
            {
                var bet = conn.QueryFirst <Bets>("select * from Bets where BetId = @betId", new { betId = 100 });

                return(bet);
            }
        }
Exemplo n.º 2
0
 public void DapperUpdateOneHundredBets()
 {
     using (var conn = ConnectionFactory.GetConnection())
     {
         for (int i = 0; i < 100; i++)
         {
             conn.Update(new Bets {
                 BetId = i, MemberId = 1, StakeAmount = 49, DateCreated = DateTime.Now, DateUpdated = DateTime.Now
             });
         }
     }
 }
Exemplo n.º 3
0
 public void DapperAddOneHundredNewBets()
 {
     using (var conn = ConnectionFactory.GetConnection())
     {
         for (int i = 0; i < 100; i++)
         {
             conn.Insert(new Bets {
                 MemberId = 1, StakeAmount = 100, DateCreated = DateTime.Now, DateUpdated = DateTime.Now
             });
         }
     }
 }