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
}

 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-11-28
  • 2021-05-31
  • 2021-12-01
  • 2021-07-04
  • 2022-01-04
猜你喜欢
  • 2021-07-13
  • 2021-11-04
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-11-23
  • 2022-01-31
相关资源
相似解决方案