Ejemplo n.º 1
0
        public void UptadeMatchup(MatchUpModel model)
        {
            using (IDbConnection connection = new System.Data.SqlClient.SqlConnection(GlobalConfig.CnnString(db)))
            {
                var p = new DynamicParameters();
                p.Add("@Id", model.Id);
                p.Add("@WinnerId", model.Winner.Id);

                connection.Execute("dbo.spMatchups_Update", p, commandType: CommandType.StoredProcedure);

                foreach (MatchUpEntryModel me in model.Entries)
                {
                    p = new DynamicParameters();
                    p.Add("@Id", me.Id);
                    p.Add("@TeamCompetingId", me.TeamCompeting.Id);
                    p.Add("@Score", me.Score);
                    connection.Execute("dbo.spMatchups_Update", p, commandType: CommandType.StoredProcedure);
                }
            }
        }
Ejemplo n.º 2
0
 public void UptadeMatchup(MatchUpModel model)
 {
     model.UpdateMatchUpToFile();
 }