Ejemplo n.º 1
0
        static void Main()
        {
            using (var db = new TelerikAcademyEntities())
            {
                var empl = db.Employees
                           .Where(e => e.Department.Name == "Sales")
                           .Select(e => new
                {
                    FirstName    = e.FirstName,
                    AddressTextt = e.Address.AddressText,
                    DN           = e.Department.Name
                })
                           .ToList();

                foreach (var e in empl)
                {
                    Console.WriteLine(e.FirstName + ' ' + e.AddressTextt + ' ' + e.DN);
                }
            }
        }
Ejemplo n.º 2
0
        static void Main()
        {
            using (var db = new TelerikAcademyEntities())
            {
                var empl = db.Employees
                    .Where(e => e.Department.Name == "Sales")
                    .Select(e => new
                    {
                       FirstName =  e.FirstName,
                       AddressTextt = e.Address.AddressText,
                       DN = e.Department.Name
                    })
                    .ToList();

                foreach (var e in empl)
                {
                    Console.WriteLine(e.FirstName + ' ' + e.AddressTextt + ' ' + e.DN);
                }

            }
        }