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

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

public static QueryOne ( ) : void
Результат void
        public static void QueryOne()
        {
            using (var dbContext = new AdventureWorks2014Entities())
            {
                Console.WriteLine("Enter last name to search: ");
                var lastName = Console.ReadLine();

                var people = dbContext.People.Select(x => x);

                foreach (var person in people)
                {
                    if (person.LastName == lastName)
                    {
                        Console.WriteLine(person.EmailAddresses.First().EmailAddress1);
                    }
                }
            }
        }