from emp in EmployeeInfolet 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}
本文共 240 字,大约阅读时间需要 1 分钟。
from emp in EmployeeInfolet 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}
转载地址:http://gaeox.baihongyu.com/