有以下代码 -
var employees = context.Employees.Where(e => e.Department.Name == "Engineering" || e.Department.Name == "Tool Design" || e.Department.Name == "Marketing" || e.Department.Name == "Information Services")
.OrderBy(e => e.FirstName)
.ThenBy(e => e.LastName)
.Select(e => new
{
employeeFullInfo = $"{e.FirstName} {e.LastName} (${e.Salary * 12 / 100 + e.Salary:F2})"
//firstName = e.FirstName,
//lastName = e.LastName,
//Salary = e.Salary * 12 / 100 + e.Salary
}).ToList();
context.SaveChanges();
当我调用 saveChanges 方法时,数据库中什么也没发生,为什么?我希望每位员工加薪 12%,但在数据库中什么也没发生
相关分类