You can create the same design but without the condition (if) ?
foreach (var item in ListItems)
{
if(item.IsChecked)
{
//
}
}
for example(not worked example):
foreach (var item in ListItems(=>IsCheked))
{
//only IsChecked
}
c#-2.0 – not use linq
C# 3 and Framework 3.5:
C# 2 , Framework 2.0 (assuming ListItems is a List)
C# 3, Framework 2.0 (if you’re using visual studio 2008 or later but targeting 2.0 framework)
The lambda syntax and
varkeyword can be compiled, but there is no System.LINQ library to refer to.