.net 6 foreach only if not null
Code Example - .net 6 foreach only if not null
List<string> items = null;
items?.ForEach(item =>
{
// ...
});
List<string> items = null;
items?.ForEach(item =>
{
// ...
});