Adventure.Works.LiveDemo.Startup.QueryThree C# (CSharp) Метод

QueryThree() публичный статический Метод

Using a projection to retrieve less data as possible from the server
public static QueryThree ( ) : void
Результат void
        public static void QueryThree()
        {
            using (var dbContext = new AdventureWorks2014Entities())
            {
                Console.WriteLine("Enter last name to search: ");
                var lastName = "Gonzalez";

                var peopleBusinessEntityIDs = dbContext.People
                    .Where(x => x.LastName == lastName)
                    .Select(x => x.BusinessEntityID);

                foreach (var businessEntityID in peopleBusinessEntityIDs)
                {
                    Console.WriteLine(businessEntityID);
                }
            }
        }