欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

EF core

程序员文章站 2024-01-04 14:46:04
...
Scaffold-DbContext "server=192.168.0.001;database=xxx;user id=sa;password=xxx;" 
Microsoft.EntityFrameworkCore.SqlServer -Tables TabManager -OutputDir DbModels11

 

//查询体温
                var accounttw = await _concardContext.TabRecord
                    .GroupJoin(_concardContext.WxTemperature, t1 => t1.AccountNo, t2 => t2.Accountno,
                        (t1, t2) => new
                        {
                            t1.Name,
                            t1.Depart,
                            Temperature = t2
                        })
                   .SelectMany(a => a.Temperature.DefaultIfEmpty(), (a, b) => new
                   {
                       a.Name,
                       a.Depart,
                       Bodytemperaturet = b.Pushtime.Date == model.datetime.Date ? b.Bodytemperature : "",
                       Pushtime = b.Pushtime.Date == model.datetime.Date ? b.Pushtime.ToString("HH:mm:ss MM月dd日") : "",
                   })
                    .Where(w => w.Depart == model.DepList)
                    .ToListAsync();

 

相关标签: .net core EF

上一篇:

下一篇: