from emp in EmployeeInfo let years = EntityFunctions.DiffYears(emp.Birthday.Value,DateTime.Now) let birthdayThisYear = EntityFunctions.AddYears(emp.Birthday.Value,years) select new { Age = birthdayThisYear > DateTime.Now ? years - 1 : years }
LINQ TO ENTITY 根据Birthday获取Age
时间: 2024-10-07 01:27:01