BolfTracker.Infrastructure.EntityFramework.ShotRepository.GetByGameAndPlayer C# (CSharp) Method

GetByGameAndPlayer() public method

public GetByGameAndPlayer ( int gameId, int playerId ) : IEnumerable
gameId int
playerId int
return IEnumerable
        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;
            }
        }