惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Simon Willison's Weblog
Simon Willison's Weblog
G
Google Developers Blog
Spread Privacy
Spread Privacy
I
InfoQ
V
V2EX
S
Schneier on Security
小众软件
小众软件
C
CERT Recently Published Vulnerability Notes
博客园 - 聂微东
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
Stack Overflow Blog
Stack Overflow Blog
T
Threat Research - Cisco Blogs
L
Lohrmann on Cybersecurity
Recent Announcements
Recent Announcements
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
Attack and Defense Labs
Attack and Defense Labs
云风的 BLOG
云风的 BLOG
The Hacker News
The Hacker News
S
SegmentFault 最新的问题
C
Cybersecurity and Infrastructure Security Agency CISA
NISL@THU
NISL@THU
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
GbyAI
GbyAI
Latest news
Latest news
S
Secure Thoughts
Project Zero
Project Zero
MongoDB | Blog
MongoDB | Blog
I
Intezer
Security Latest
Security Latest
Apple Machine Learning Research
Apple Machine Learning Research
Vercel News
Vercel News
N
Netflix TechBlog - Medium
V2EX - 技术
V2EX - 技术
量子位
T
Threatpost
T
The Blog of Author Tim Ferriss
Y
Y Combinator Blog
T
Tor Project blog
A
Arctic Wolf
Microsoft Security Blog
Microsoft Security Blog
T
The Exploit Database - CXSecurity.com
大猫的无限游戏
大猫的无限游戏
T
Tailwind CSS Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
C
Check Point Blog
博客园 - Franky
Google DeepMind News
Google DeepMind News
The Register - Security
The Register - Security
The GitHub Blog
The GitHub Blog
L
LINUX DO - 热门话题

博客园 - J-Pei

entity framework ConnectionString include password Microsoft Visual Studio无法启动程序进行调试的解决方法 通过Process调用桌面程序 深入理解Javascript闭包(closure) 安装SQL Server 2005过程出现错误:“SQL Server 服务无法启动”的解决办法 动态修改div的xy值 asp.net mvc 与jquery应用总结 Ajax 选项 这才是真正的JQuery.ajax传递中文参数的解决方法 ASP.NET MVC生命周期介绍(转) ASP.NET页生命周期介绍:阶段,事件及其他(转) JQuery 实现网页的快捷键操作 IE8下json.js 中文编码问题 Meet Chirpy sybase性能调优 Entity FrameWork 4.1 RC 生成的sql语法性能存在问题 ADO.NET Entity FrameWork 4.1 RC 发布 服务器返回json SQL SERVER 2008 MASTER数据库损坏修复
asp.net MVC EF dynamic query
J-Pei · 2011-03-16 · via 博客园 - J-Pei

Entity FrameWork 4.1
public SearchMyThings( string a, string b, int c )
{
     
var mywidgets = DBContext.DbSet<Widget>();
     
     if( !a.IsNullOrEmpty )
        mywidgets
= mywidgets.Where( w => w.AProperty == a );if( !b.IsNullOrEmpty )
        mywidgets
= mywidgets.Where( w => w.BProperty == b );if( c > 0 )
        mywidgets
= mywidgets.Where( c => c.CProperty == c );}