Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
如何将此查询从 MySQL 转换为 LINQ?
SELECT SUM(IF(x>0, c*(x/100),20.00)) AS x1 FROM tablename WHERE uid="some value" AND name='some value';
var sum = testlist.Where(item => item.name == "somevalue" && item.uid == "somevalue") .Sum(c => c.x > 0 ? c.c*(c.x/100) : 20);
尝试这个
试试这个工具。
http://softwaretopic.informer.com/sql-to-linq-converter-online-free/