当前位置:网站首页>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
边栏推荐
- 电话系统规则
- Jia Yueting's Faraday will receive another financing of US $225million in the future, and ff91 will be mass produced soon!
- By default, the select drop-down box selects the solution ligerui that the selected attribute does not work
- Servlet framework (servlet+jsp) + addition, deletion, modification and query + paging implemented by MySQL (function package student information entry, addition, deletion, modification and query of st
- 如何在 PHP 中防止 XSS
- Solution to deepin taskbar disappearance
- Wentai technology's revenue in the first quarter soared by 184.6% year-on-year, and its net profit soared by 256.21%!
- Hping3 installation and use
- Leetcode:162. looking for peak [two points looking for peak]
- Urban safety series popular science - enter the high incidence period of drowning, if you know the common sense of life-saving
猜你喜欢

ArcGIS pixel size changed from 0.00025 to meters

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

TCP protocol debugging tool tcpengine v1.3.0 tutorial

Jupyter uses tips

Thinkphp3.2.5 cannot jump to external links

多线程(基础)

31 next spread

leetcode:162. 寻找峰值【二分寻找峰值】

1184. 公交站间的距离

15、ARM嵌入式系统:如何用PC调试单板
随机推荐
ARP 入门
Summary of experience in using.Net test framework xUnit, mstest, specflow
Jenkins CLI 命令详解
1163: 松哥的分数拆分(C语言)
How to deal with the start and end times in mybatics
Quickly view the version of redis in the server
Qt设计机器人仿真控制器——按键控制机器人关节转动
Intel plans to sell baseband chip business, but Apple has given up?
With notes: printing order of synchronous, asynchronous, micro task and macro task
Qt设计仿真机器人控制器
城市安全系列科普丨进入溺水高发期,救生常识话你知
MySQL converts strings to numeric types and sorts them
ZBar source code analysis - img_ scanner. c | [email protected]
Code shoe set - mt2093 · palindrome digit
QT design robot simulation controller -- key control robot joint rotation
简易版QQ?Qt也可以实现!(一)
Jenkins cli command details
TCP protocol debugging tool tcpengine v1.3.0 tutorial
105 constructing binary trees from preorder and inorder traversal sequences
.net review the old and know the new: [6] what is LINQ