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

推荐订阅源

GbyAI
GbyAI
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
IT之家
IT之家
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
N
News | PayPal Newsroom
Cloudbric
Cloudbric
Webroot Blog
Webroot Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
Simon Willison's Weblog
Simon Willison's Weblog
Spread Privacy
Spread Privacy
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
V
Vulnerabilities – Threatpost
Attack and Defense Labs
Attack and Defense Labs
C
Cyber Attacks, Cyber Crime and Cyber Security
Cisco Talos Blog
Cisco Talos Blog
C
Cybersecurity and Infrastructure Security Agency CISA
H
Hackread – Cybersecurity News, Data Breaches, AI and More
P
Proofpoint News Feed
阮一峰的网络日志
阮一峰的网络日志
S
Secure Thoughts
T
Tor Project blog
Latest news
Latest news
aimingoo的专栏
aimingoo的专栏
V2EX - 技术
V2EX - 技术
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
S
Securelist
T
Tenable Blog
N
Netflix TechBlog - Medium
Google Online Security Blog
Google Online Security Blog
博客园 - Franky
T
Troy Hunt's Blog
量子位
大猫的无限游戏
大猫的无限游戏
T
Threat Research - Cisco Blogs
T
The Exploit Database - CXSecurity.com
MongoDB | Blog
MongoDB | Blog
H
Heimdal Security Blog
D
Docker
W
WeLiveSecurity
Stack Overflow Blog
Stack Overflow Blog
G
Google Developers Blog
博客园 - 叶小钗
腾讯CDC
The Hacker News
The Hacker News
WordPress大学
WordPress大学
人人都是产品经理
人人都是产品经理
Project Zero
Project Zero
Martin Fowler
Martin Fowler

博客园 - leegool

常见XSD问题 抗投诉空间 C#用WebClient下载File时操作超时的问题 用C# 实现 Zen Cart 的用户密码加密算法 ASP.NET MVC 3 新特性 ASP.NET MVC 局部缓存实现 用户控件缓存 Partial Output Caching - leegool System.Web.Security.SqlMembershipProvider”要求一个与架构版本“1”兼容的数据库架构。 关于MarshalByRefObject的解释 MVC upload image MVC上传图片的例子 - leegool jQuery Custom Selector JQuery自定义选择器 - leegool 清楚浏览器缓存 Overview of Full Text Stop Words(MSSQL全文索引的干扰词概括)MSSQL 全文索引的最小单词长度 JQuery性能优化 MS SQL 事务隔离级别 认识ASP.NET 中的 AppDomain 国外服务器上 中文成 显示乱码 Sharing cookie Across domain 跨域cookie访问 cookie跨域 web性能优化(最佳) EntitySpaces 2009 Trial Expire 异常
EntitySpace 常用语句
leegool · 2015-04-06 · via 博客园 - leegool

EntitySpace 这个是很早期的ORM框架,最近发现这个破解的也都不能用了。有谁知道能用的,联系我。

1. where带几个条件的 

query.Where(query.ProductTempStatus.Equal((int)tempStatus) | query.ProductStatus.Equal((int)status));

 query.Where(query.ProductTempStatus.Equal((int)tempStatus) && query.ProductStatus.Equal((int)status));

2. 批量更新的:

 public bool UpdateProductTempStatusBatch(List<int> productIds,ProductTempStatus status)
        {
            try
            {


                AwhProducts product = new AwhProducts();
                AwhProductsCollection products = new AwhProductsCollection();
                AwhProductsQuery query = new AwhProductsQuery();

                query.Where(query.ProductID.In(productIds));

                products.Load(query);

                foreach (var item in products)
                {
                    item.ProductTempStatus = (int)status;
                }

                products.Save();

                return true;

            }
            catch (Exception ex)
            {
                return false;
            }

        }

3. 使用事务

//MYSQL的事务语句无效

 using (esTransactionScope scope = new esTransactionScope())
 {

...

...

 product.Save();

brand.Save();

scope.Complete();

}

其它事务的用法:

 using (esTransactionScope noTrans = new esTransactionScope(esTransactionScopeOption.Suppress))

 using (esTransactionScope rootTrans2 = new esTransactionScope(esTransactionScopeOption.RequiresNew))

查看这里:

http://www.entityspaces.net/blog/CategoryView,category,Transactions.aspx

4.人工执行SQL语句

esUtility util = new esUtility();
int count = (int)util.ExecuteScalar(esQueryType.Text, "Select Count(*) From Employees");