public IEnumerable<Shot> All() { using (var context = new BolfTrackerContext()) { return context.Shots.ToList(); } }
public IEnumerable<PlayerCareerStatistics> All() { using (var context = new BolfTrackerContext()) { return context.PlayerCareerStatistics.Include(pcs => pcs.Player).ToList(); } }
public IEnumerable <Hole> All() { using (var context = new BolfTrackerContext()) { return(context.Holes.ToList()); } }
public IEnumerable<GameStatistics> All() { using (var context = new BolfTrackerContext()) { return context.GameStatistics.ToList(); } }
public void DeleteAll() { using (var context = new BolfTrackerContext()) { context.Database.ExecuteSqlCommand("DELETE FROM PlayerCareerStatistics"); } }
public IEnumerable<Player> All() { using (var context = new BolfTrackerContext()) { return context.Players.ToList(); } }
public IEnumerable <PlayerCareerStatistics> All() { using (var context = new BolfTrackerContext()) { return(context.PlayerCareerStatistics.Include(pcs => pcs.Player).ToList()); } }
public IEnumerable <PlayerHoleStatistics> All() { using (var context = new BolfTrackerContext()) { return(context.PlayerHoleStatistics.ToList()); } }
public IEnumerable<Hole> All() { using (var context = new BolfTrackerContext()) { return context.Holes.ToList(); } }
public void DeleteByMonthAndYear(int month, int year) { using (var context = new BolfTrackerContext()) { context.Database.ExecuteSqlCommand("DELETE FROM HoleStatistics WHERE Month = @Month AND Year = @Year", new SqlParameter { ParameterName = "Month", Value = month }, new SqlParameter { ParameterName = "Year", Value = year }); } }
public IEnumerable <Shot> All() { using (var context = new BolfTrackerContext()) { return(context.Shots.ToList()); } }
public void Delete(Hole model) { using (var context = new BolfTrackerContext()) { context.Holes.Remove(model); context.SaveChanges(); } }
public void Delete(GameStatistics model) { using (var context = new BolfTrackerContext()) { context.GameStatistics.Remove(model); context.SaveChanges(); } }
public void Update(Player player) { using (var context = new BolfTrackerContext()) { context.Entry<Player>(player).State = EntityState.Modified; context.SaveChanges(); } }
public void Update(Player player) { using (var context = new BolfTrackerContext()) { context.Entry <Player>(player).State = EntityState.Modified; context.SaveChanges(); } }
public void Delete(PlayerHoleStatistics model) { using (var context = new BolfTrackerContext()) { context.PlayerHoleStatistics.Remove(model); context.SaveChanges(); } }
public Player GetById(int id) { using (var context = new BolfTrackerContext()) { var ranking = context.Players.SingleOrDefault(r => r.Id == id); return ranking; } }
public IEnumerable <Ranking> GetByMonthAndYear(int month, int year) { using (var context = new BolfTrackerContext()) { var rankings = context.Rankings.Include(ranking => ranking.Player).Where(ranking => ranking.Month == month && ranking.Year == year).ToList(); return(rankings); } }
public PlayerGameStatistics GetById(int id) { using (var context = new BolfTrackerContext()) { var playerGameStatistics = context.PlayerGameStatistics.SingleOrDefault(pgs => pgs.Id == id); return playerGameStatistics; } }
public IEnumerable <PlayerGameStatistics> All() { using (var context = new BolfTrackerContext()) { var playerGameStatistics = context.PlayerGameStatistics.ToList(); return(playerGameStatistics); } }
public PlayerCareerStatistics GetById(int id) { using (var context = new BolfTrackerContext()) { var query = context.PlayerCareerStatistics.SingleOrDefault(pcs => pcs.Id == id); return(query); } }
public IEnumerable <PlayerHoleStatistics> GetByMonthAndYear(int month, int year) { using (var context = new BolfTrackerContext()) { var playerHoleStatistics = context.PlayerHoleStatistics.Include(phs => phs.Player).Include(phs => phs.Hole).Where(phs => phs.Month == month && phs.Year == year).ToList(); return(playerHoleStatistics); } }
public void Add(Hole model) { using (var context = new BolfTrackerContext()) { context.Holes.Attach(model); context.Entry(model).State = EntityState.Added; context.SaveChanges(); } }
public void Add(Shot shot) { using (var context = new BolfTrackerContext()) { context.Shots.Attach(shot); context.Entry(shot).State = EntityState.Added; context.SaveChanges(); } }
public IEnumerable <Player> GetByGame(int gameId) { using (var context = new BolfTrackerContext()) { var players = context.Shots.Where(shot => shot.Game.Id == gameId).Select(shot => shot.Player).Distinct().ToList(); return(players); } }
public Player GetByName(string name) { using (var context = new BolfTrackerContext()) { var player = context.Players.First(p => p.Name == name); return(player); } }
public Player GetById(int id) { using (var context = new BolfTrackerContext()) { var ranking = context.Players.SingleOrDefault(r => r.Id == id); return(ranking); } }
public ShotType GetById(int id) { using (var context = new BolfTrackerContext()) { var shotType = context.ShotTypes.SingleOrDefault(st => st.Id == id); return shotType; } }
public PlayerHoleStatistics GetById(int id) { using (var context = new BolfTrackerContext()) { var playerHoleStatistics = context.PlayerHoleStatistics.SingleOrDefault(phs => phs.Id == id); return(playerHoleStatistics); } }
public IEnumerable<Shot> GetByGameAndPlayer(int gameId, int playerId) { using (var context = new BolfTrackerContext()) { var shots = context.Shots.Include(shot => shot.ShotType).Include(shot => shot.Hole).Include(shot => shot.Player).Include(shot => shot.Game).Where(shot => shot.Game.Id == gameId && shot.Player.Id == playerId).ToList(); return shots; } }
public Shot GetById(int id) { using (var context = new BolfTrackerContext()) { var shot = context.Shots.Include(s => s.ShotType).Include(s => s.Hole).Include(s => s.Player).Include(s => s.Game).SingleOrDefault(s => s.Id == id); return shot; } }
public IEnumerable <Hole> GetActiveByMonthAndYear(int month, int year) { using (var context = new BolfTrackerContext()) { var holes = context.Shots.Where(shot => shot.Game.Date.Month == month && shot.Game.Date.Year == year).Select(shot => shot.Hole).Include(hole => hole.Shots.Where(shot => shot.Game.Date.Month == month && shot.Game.Date.Year == year)).Distinct().ToList(); return(holes); } }
public IEnumerable<HoleStatistics> GetByMonthAndYear(int month, int year) { using (var context = new BolfTrackerContext()) { var holeStatistics = context.HoleStatistics.Include(hs => hs.Hole).Where(hs => hs.Month == month && hs.Year == year).ToList(); return holeStatistics; } }
public Hole GetById(int id) { using (var context = new BolfTrackerContext()) { var hole = context.Holes.SingleOrDefault(g => g.Id == id); return(hole); } }
public IEnumerable<PlayerGameStatistics> All() { using (var context = new BolfTrackerContext()) { var playerGameStatistics = context.PlayerGameStatistics.ToList(); return playerGameStatistics; } }
public PlayerCareerStatistics GetById(int id) { using (var context = new BolfTrackerContext()) { var query = context.PlayerCareerStatistics.SingleOrDefault(pcs => pcs.Id == id); return query; } }
public IEnumerable <Ranking> All() { using (var context = new BolfTrackerContext()) { var rankings = context.Rankings.ToList(); return(rankings); } }
public IEnumerable<Hole> GetActiveByMonthAndYear(int month, int year) { using (var context = new BolfTrackerContext()) { var holes = context.Shots.Where(shot => shot.Game.Date.Month == month && shot.Game.Date.Year == year).Select(shot => shot.Hole).Include(hole => hole.Shots.Where(shot => shot.Game.Date.Month == month && shot.Game.Date.Year == year)).Distinct().ToList(); return holes; } }
public GameStatistics GetById(int id) { using (var context = new BolfTrackerContext()) { var gameStatistic = context.GameStatistics.SingleOrDefault(gs => gs.Id == id); return gameStatistic; } }
public void Add(PlayerRivalryStatistics model) { using (var context = new BolfTrackerContext()) { context.PlayerRivalryStatistics.Attach(model); context.Entry(model).State = EntityState.Added; context.SaveChanges(); } }
public IEnumerable<Player> GetByGame(int gameId) { using (var context = new BolfTrackerContext()) { var players = context.Shots.Where(shot => shot.Game.Id == gameId).Select(shot => shot.Player).Distinct().ToList(); return players; } }
public IEnumerable<PlayerHoleStatistics> GetByPlayerMonthAndYear(int playerId, int month, int year) { using (var context = new BolfTrackerContext()) { var playerHoleStatistics = context.PlayerHoleStatistics.Include(phs => phs.Player).Include(phs => phs.Hole).Where(phs => phs.Player.Id == playerId && phs.Month == month && phs.Year == year).ToList(); return playerHoleStatistics; } }
public Player GetByName(string name) { using (var context = new BolfTrackerContext()) { var player = context.Players.First(p => p.Name == name); return player; } }
public GameStatistics GetById(int id) { using (var context = new BolfTrackerContext()) { var gameStatistic = context.GameStatistics.Include(gs => gs.Game).SingleOrDefault(gs => gs.Id == id); return(gameStatistic); } }
public HoleStatistics GetById(int id) { using (var context = new BolfTrackerContext()) { var holeStatistic = context.HoleStatistics.SingleOrDefault(hs => hs.Id == id); return(holeStatistic); } }
public void Delete(GameStatistics model) { using (var context = new BolfTrackerContext()) { context.GameStatistics.Attach(model); context.GameStatistics.Remove(model); context.SaveChanges(); } }
public PlayerHoleStatistics GetByPlayerHoleMonthAndYear(int playerId, int holeId, int month, int year) { using (var context = new BolfTrackerContext()) { var playerHoleStatistics = context.PlayerHoleStatistics.Include(phs => phs.Player).Include(phs => phs.Hole).First(phs => phs.Player.Id == playerId && phs.Hole.Id == holeId && phs.Month == month && phs.Year == year); return(playerHoleStatistics); } }
public PlayerGameStatistics GetById(int id) { using (var context = new BolfTrackerContext()) { var playerGameStatistics = context.PlayerGameStatistics.Include(pgs => pgs.Game).SingleOrDefault(pgs => pgs.Id == id); return(playerGameStatistics); } }
public PlayerCareerStatistics GetByPlayer(int playerId) { using (var context = new BolfTrackerContext()) { var query = context.PlayerCareerStatistics.Include(pcs => pcs.Player).FirstOrDefault(pcs => pcs.Player.Id == playerId); return(query); } }
public IEnumerable <PlayerGameStatistics> GetByPlayer(int playerId) { using (var context = new BolfTrackerContext()) { var playerGameStatistics = context.PlayerGameStatistics.Include(pgs => pgs.Player).Include(pgs => pgs.Game).Where(pgs => pgs.Player.Id == playerId).ToList(); return(playerGameStatistics); } }
public IEnumerable <PlayerGameStatistics> GetByPlayerMonthAndYear(int playerId, int month, int year) { using (var context = new BolfTrackerContext()) { var playerGameStatistics = context.PlayerGameStatistics.Include(pgs => pgs.Player).Include(pgs => pgs.Game).Where(pgs => pgs.Player.Id == playerId && pgs.Game.Date.Month == month && pgs.Game.Date.Year == year).ToList(); return(playerGameStatistics); } }
public PlayerCareerStatistics GetByPlayer(int playerId) { using (var context = new BolfTrackerContext()) { var query = context.PlayerCareerStatistics.Include(pcs => pcs.Player).FirstOrDefault(pcs => pcs.Player.Id == playerId); return query; } }
public HoleStatistics GetById(int id) { using (var context = new BolfTrackerContext()) { var holeStatistic = context.HoleStatistics.SingleOrDefault(hs => hs.Id == id); return holeStatistic; } }
public Hole GetById(int id) { using (var context = new BolfTrackerContext()) { var hole = context.Holes.SingleOrDefault(g => g.Id == id); return hole; } }
public PlayerStatistics GetByPlayerMonthAndYear(int playerId, int month, int year) { using (var context = new BolfTrackerContext()) { var playerStatistics = context.PlayerStatistics.Include(ps => ps.Player).SingleOrDefault(ps => ps.Player.Id == playerId && ps.Month == month && ps.Year == year); return(playerStatistics); } }
public Game GetById(int id) { using (var context = new BolfTrackerContext()) { var game = context.Games.Include(g => g.GameStatistics).SingleOrDefault(g => g.Id == id); return game; } }