示例#1
0
 private static void ShowPeopleInACompany()
 {
     eksempeldbEntities db = new eksempeldbEntities();
     var peopleincompany   = from person in db.people
                             where person.firmas.Count > 0
                             select person;
 }
示例#2
0
        private static void ShowPersonWSalaryHigherThan(int salary)
        {
            eksempeldbEntities db = new eksempeldbEntities();

            Console.WriteLine("Returner løninger der er højere end " + salary);
            Console.WriteLine();
            var t = from l in db.people
                    where l.loen > salary
                    select l;

            foreach (var loen in t)
            {
                Console.WriteLine(loen.loen);
            }
            Console.ReadLine();
        }
示例#3
0
        private static void MovePeopleToArrayWSalaryHigherThan(int salary)
        {
            eksempeldbEntities   db          = new eksempeldbEntities();
            IEnumerable <person> arrayperson = null;


            var t = from l in db.people
                    where l.loen > salary
                    select l;

            arrayperson = t.ToArray();

            foreach (var loninger in arrayperson)
            {
                Console.WriteLine(loninger.loen);
            }
            Console.ReadLine();
        }