当前位置:网站首页>EF miscellaneous
EF miscellaneous
2022-07-24 16:30:00 【Weiwei became a father】
Context.Entry<Job>(job).State = System.Data.Entity.EntityState.Modified;// to update
//Job type
//job object EF Timeout problem
// Connection timeout
Connection Timeout=60;// Add to the connection string
// Execution timeout
_test.Database.CommandTimeout = 180;EF Handle In the database null The problem of
var query=from f in db.tb_flag
where Nullable<int>.Equals(f.flag,null) select f;
// Generated SQL Statement for where flag is null
// Write the connection string in the program
public Context()// Write the corresponding information directly in the constructor of the context , Then you can delete app.config/web.config
: base("server=WAYLIPC;database=Programme;uid=sa;pwd=1987214li;")
{
}//linq Include lookup
List<CodeFirst.ProductReCord> tt = _context.ProductReCords.Where(o => new int[] { 1, 2,3,4,5,6 }.Contains(o.Id)).ToList();
//==sql
SELECT * FROM dbo.ProductReCord WHERE Id IN (1,2,3,4,5,6)//Linq Fuzzy search
var ct=_context.ProductReCords.Where(o => o.FileName.StartsWith("a") && o.FileName.EndsWith("t")&&o.FileName .Contains("abc")).Select(o=>new {o.Id,o.FileName,o.JobNum ,o.Check_Sum});
//StartsWith Match start string a%
//EndsWith Match end string %a
//Contains contain %a%
Here is sql
SELECT
[Extent1].[Id] AS [Id],
[Extent1].[FileName] AS [FileName],
[Extent1].[JobNum] AS [JobNum],
[Extent1].[Check_Sum] AS [Check_Sum]
FROM [dbo].[ProductReCord] AS [Extent1]
WHERE ([Extent1].[FileName] LIKE 'a%') AND ([Extent1].[FileName] LIKE '%t') AND ([Extent1].[FileName] LIKE '%abc%')
边栏推荐
- 15. ARM embedded system: how to debug single board with PC
- 'resultmap'must match' (constructor?, id*, result*, association*, collect problem solving
- QT keyboard event (II) -- long press the key to trigger the event event repeatedly, and the problem is solved
- About SQL data query statements
- Servlet框架(servlet+jsp)+Mysql实现的增删改查+分页(功能包学生信息录入、学生信息增删改查、分页等)
- Enter a URL to this page to show it. What happened in this process?
- Software recommendation - office software
- Huawei Kirin 985 mass production in the third quarter: TSMC 7Nm EUV process, integrated 5g baseband!
- Due to lack of funds, Changdian technology sold some assets of Xingke Jinpeng for 120million US dollars!
- 287 finding duplicates
猜你喜欢

C# TCP客户端窗体应用程序异步接收方式

期盼已久全平台支持-开源IM项目OpenIM之uniapp更新

How vscode mouse wheel enlarges the interface

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

Using native JS to realize magnifying glass function

15、ARM嵌入式系统:如何用PC调试单板

TCP协议调试工具TcpEngine V1.3.0使用教程

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

124 maximum path sum in binary tree

How to prevent XSS in PHP
随机推荐
我们为什么要推出Getaverse?
Telephone system rules
Simple QQ? QT can also be achieved! (I)
GEO satellite data download
Chapter 2 using API Mgmnt service
TCP protocol debugging tool tcpengine v1.3.0 tutorial
EventLoop event loop mechanism
Codeforces round 690 (Div. 3) C. unique number conventional solution
Druid integration shardingsphere appears xxmapper Reasons and solutions of XML error reporting
[machine learning basics] - another perspective to explain SVM
[leetcode] day102 spiral matrix II
[leetcode]75. color classification - problem solving (execution time beat 90%, memory consumption beat 78%)
在 PHP Web 应用程序中防止 XSS 的最佳实践
Quickly view the version of redis in the server
C# TCP客户端窗体应用程序异步接收方式
1184. 公交站间的距离
Mobile phone comparison redmi note8 and realm x2
ZBar source code analysis - img_ scanner. c | [email protected]
详解 Apache Hudi Schema Evolution(模式演进)
ARP 入门