Beispiel #1
0
 public static void Cut(this CompanyDataClassesDataContext company)
 {
     foreach (var employee in company.Employees)
     {
         employee.Salary /= 2;
     }
     company.SubmitChanges();
 }
Beispiel #2
0
        public static decimal Total(this CompanyDataClassesDataContext company)
        {
            var res = company.Employees.Sum(emp => emp.Salary);

            if (res != null)
            {
                return((decimal)res);
            }

            return(0M);
        }