ORMBenchmarksTest.DataAccess.EntityFramework.GetPlayersForTeam C# (CSharp) 메소드

GetPlayersForTeam() 공개 메소드

public GetPlayersForTeam ( int teamId ) : long
teamId int
리턴 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;
        }