当前位置:网站首页>EF LINQ Miscellany
EF LINQ Miscellany
2022-07-24 16:29:00 【Weiwei became a father】
var ccc = (from o in Context.BoxLogs
join oo in Context.Jobs
on o.JobId equals oo.Id
join ooo in Context.PositionInfoes
on o.PositionId equals ooo.SortNum
join o4 in Context.Lines
on o.LinId equals o4.LineId
into re // Zodiac
from r in re.DefaultIfEmpty()
where oo.JobNumber.Equals(jobName)
select new
{
oo.JobNumber,
ooo.PostionName,
o.FullBoxSn,
r.LineName,
Status = o.IsComplete == true ? " Already used ": " not used " //linq case when
}).ToList();
// Find the station through the work order ,Sn, Line type , And use status 
// BoxLog Is a database entity
//PositionInfo Is a database entity
var tt = Context.BoxLogs.Join(Context.PositionInfoes, (BoxLog o) => o.PositionId, (PositionInfo p) => p.SortNum, (o, oo) => new
{
o.PositionId,
oo.PostionName
}).ToList();
//EF Write in SQL sentence
This is search
string sn = "G8T1GH000402PXJD";
using (EF.RecordTest test = new EF.RecordTest())
{
string sql = "SELECT * FROM dbo.ims_success_logfiles WHERE test_type_name LIKE '" + sn + "%' AND Rework_Clear_Flag IS NULL";
//List<EF.ims_success_logfiles> cct = test.ims_success_logfiles.SqlQuery(sql).ToList();
Find that the upper one is slower than the lower one
List<EF.ims_success_logfiles> ccc= test.Database.SqlQuery<EF.ims_success_logfiles>(sql).ToList();
}
// Use it directly QSL Statement and the following sql The sentence is the same .
SELECT * FROM dbo.ims_success_logfiles WHERE test_type_name LIKE 'G8T1GH000402PXJD%' AND Rework_Clear_Flag IS NULLThe following example is to update , Add and delete
边栏推荐
- QT design robot simulation controller -- key control robot joint rotation
- You really should go to the factory to move bricks!
- Qt设计机器人仿真控制器——按键控制机器人关节转动
- Servlet框架(servlet+jsp)+Mysql实现的增删改查+分页(功能包学生信息录入、学生信息增删改查、分页等)
- 做完数据治理,质量依旧很差
- [Nanjing Agricultural University] information sharing of postgraduate entrance examination and re examination
- What does Baidu promote "delete and recall" mean?
- Telephone system rules
- Cache penetration, cache breakdown, cache avalanche differences and solutions [easy to understand]
- 简易版QQ?Qt也可以实现!(一)
猜你喜欢

简单使用 MySQL 索引

Servlet框架(servlet+jsp)+Mysql实现的增删改查+分页(功能包学生信息录入、学生信息增删改查、分页等)

After data management, the quality is still poor

如何防止跨站点脚本 (XSS) 攻击完整指南

How to prevent XSS in PHP

thinkphp3.2.5无法跳转到外部链接

31 next spread

我们为什么要推出Getaverse?

Simply use MySQL index
[email protected]"/>ZBar project introduction and installation configuration| [email protected]
随机推荐
GEO satellite data download
'resultmap'must match' (constructor?, id*, result*, association*, collect problem solving
百度推广“删除重提”是什么意思?
电话系统规则
ArcGIS layer annotation display
After data management, the quality is still poor
Ligerui table control grid changes the color of rows (cells) according to the content
期盼已久全平台支持-开源IM项目OpenIM之uniapp更新
1184. 公交站间的距离
ZBar project introduction and installation configuration| [email protected]
Talk about C pointer
.net review the old and know the new: [6] what is LINQ
【LeetCode】Day103-搜索二维矩阵 II
Qualcomm reconciled with apple and received at least $4.5 billion in settlement fees! Next goal: Huawei!
VSCode如何鼠标滚轮放大界面
在 PHP Web 应用程序中防止 XSS 的最佳实践
Best practices for preventing XSS in PHP web applications
287 finding duplicates
Software recommendation - Mechanical Major
安全的证券公司有哪些?我想在手机上买股票