ORMBenchmarksTest.DataAccess.EntityFramework.GetPlayersForTeam C# (CSharp) Method

GetPlayersForTeam() public method

public GetPlayersForTeam ( int teamId ) : long
teamId int
return long
        public long GetPlayersForTeam(int teamId)
        {
            Stopwatch watch = new Stopwatch();
            watch.Start();
            using (SportContext context = new SportContext())
            {
                var players = context.Players.AsNoTracking().Where(x => x.TeamId == teamId).ToList();
            }
            watch.Stop();
            return watch.ElapsedMilliseconds;
        }