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

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

            return(0M);
        }