I was getting an error about trying to push null into the field, which was a Foreign key in the table I was using. So I changed it, but I am not sure if I grabbed the right object, so I want to print what I just pushed the database table. I am aware that I can query the table, but given that I only see the id, and it is almost midnight, I feel better if I can just print it and make sure it is the value I just created in the form. Here is the code...
foreach (TeamModel tm in model.EnteredTeams)
{
var p = new DynamicParameters();
p.Add("@TournamentId", model.Id);
//p.Add("@PrizeId", tm.Id);
//p.Add("@PrizeId", model.Prizes);
p.Add("@PrizeId", model.Prizes.First().Id);
p.Add("@Id", 0, dbType: DbType.Int32, direction: ParameterDirection.Output);
connection.Execute("spTournamentPrizes_Insert", p, commandType: CommandType.StoredProcedure);
MessageBox.Show("This is the prize you just pushed to the Database." , model.Prizes.First());
}
As you can see I am trying to use MessageBox, but it is only for strings apparently according to the documentation I read. How can I print what is the Prize object?