var data = db.Invoice.Select(i => new InvoiceVM
{
InvoiceId = i.InvoiceId,
GroupIds = SqlFunctions.DateName("yyyy", i.BillDate )+"-"+SqlFunctions.DateName("MM", i.BillDate ),
Description = i.Description, CreateDate = i.CreateDate, }).OrderBy(i => i.InvoiceCode);
}
还有其它用法:
SqlFunctions.StringConvert(256236.36592,10,2)
标签:Enitty,Lamda,BillDate,Description,CreateDate,SqlFunctions,DateName,InvoiceId From: https://blog.51cto.com/u_176133/8016360