public void InsertMatch(SoccerMatchModel match) { match.IDMatch = Guid.NewGuid(); //generate new id // dbContext.Matches.InsertOnSubmit(MapModelToDbObject(match)); dbContext.SoccerMatches.InsertOnSubmit(match.MapObject <Models.DBObjects.SoccerMatch>()); //add to ORM layer dbContext.SubmitChanges(); //commit to db }
public void InsertLeague(LeagueModel league) { league.IDLeague = Guid.NewGuid(); //generate new id // dbContext.Leagues.InsertOnSubmit(MapModelToDbObject(leagueModel)); dbContext.Leagues.InsertOnSubmit(league.MapObject <Models.DBObjects.League>()); //add to ORM layer dbContext.SubmitChanges(); //commit to db }
public void InsertTeam(TeamModel team) { team.IDTeam = Guid.NewGuid(); //generate new id // dbContext.Teams.InsertOnSubmit(MapModelToDbObject(teamModel)); dbContext.Teams.InsertOnSubmit(team.MapObject <Models.DBObjects.Team>()); //add to ORM layer dbContext.SubmitChanges(); //commit to db }
public void InsertPlayer(PlayerModel player) { player.IDPlayer = Guid.NewGuid(); //generate new id // dbContext.Players.InsertOnSubmit(MapModelToDbObject(player)); dbContext.Players.InsertOnSubmit(player.MapObject <Models.DBObjects.Player>()); //add to ORM layer dbContext.SubmitChanges(); //commit to db }