• Knowledge Base
  • Statistic
KB Champion May! chandra
  1. Home
  2. Linq

Linq

Linq to SQL Group By Multiple Column

Posted on April 17, 2015April 17, 2015 by Chandra Oemaryadi

Fungsi Linq untuk group by multiple column select * from … group by (col A, col B) [code language=”csharp”] people.GroupBy(m => new { m.MasterArea, m.Role }).Select(m => new { MasterArea = m.Key.MasterArea, Role = m.Key.Role, Count = m.Count()}); [/code]

Read more

Read more

  Posted in ASP.NET MVC Tagged Linq    Leave a comment

EntityFramework Linq Queryable.Sum returns Null on an empty list

Posted on June 9, 2014 by Chandra Oemaryadi

Penanganan ketika memanggil fungsi sum, padahal data masih kosong. [code language=”csharp”] items.Sum(m => (int?)m.value) ?? 0 [/code] http://ilmatte.wordpress.com/2012/12/20/queryable-sum-on-decimal-and-null-return-value-with-linq-to-entities/

Read more

Read more

  Posted in ASP.NET MVC Tagged Entity Framework, Linq    Leave a comment

Proudly powered by WordPress | Theme: WP Knowledge Base by iPanelThemes.com.