using System.Collections.Generic;
public class DeviceConfiguration
public string ContentTree { get; set; }
public class DeviceConnection
public string ConnectionId { get; set; }
public DeviceConfiguration DeviceConfiguration { get; set; }
public static void Main()
IEnumerable<DeviceConnection> nonNullIEnumerable = new List<DeviceConnection>
new DeviceConnection { ConnectionId = "a", DeviceConfiguration = null},
new DeviceConnection { ConnectionId = "b", DeviceConfiguration = new DeviceConfiguration {ContentTree = "ct"}},
new DeviceConnection { ConnectionId = "c", DeviceConfiguration = null},
if (nonNullIEnumerable != null && nonNullIEnumerable.Any())
var result = nonNullIEnumerable.Where(x => x.DeviceConfiguration == null).ToList();
Console.Write(string.Join(",\n",result.Select(x => x.ConnectionId)));
Console.Write("empty or null");