//Query syntax:
IEnumerable<int> numQuery1 =
from num in numbers
where num % 2 == 0
orderby num
select num;
//Method syntax:
IEnumerable<int> numQuery2 = numbers.Where(num => num % 2 == 0).OrderBy(n => n);
大昔のJavaやVBのような開発者だったら、SQLは見たことあるけどラムダ式は見たことないって人がいるだろうから、そういう人には上の方が読みやすいのかも。
Embed Notice
HTML Code
Corresponding Notice
- Embed this notice
くっしー:sabakan: (kussy_tessy@d.kg-misskey.net)'s status on Friday, 20-Dec-2024 14:56:20 JST くっしー:sabakan: