سؤال

What is the way to code this query with Linq to Entities (method based syntax)?

select sum(ceiling((PackSize)/50)) from table1;

Thanks

هل كانت مفيدة؟

المحلول

var query = context.Table1.Sum(x => Math.Ceiling(x.PackSize/50));
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top