/// <summary> /// Check to see if there are any related Lights, and load them if requested /// </summary> public static void CheckExpandLights(SqlDataManager sdm, IEnumerable <MCDevice> mCDevices, string expandString) { var mCDevicesWhere = CreateMCDeviceWhere(mCDevices); expandString = expandString.SafeToString(); if (String.Equals(expandString, "all", StringComparison.OrdinalIgnoreCase) || expandString.IndexOf("lights", StringComparison.OrdinalIgnoreCase) >= 0) { var childLights = sdm.GetAllLights <Light>(mCDevicesWhere); mCDevices.ToList() .ForEach(feMCDevice => feMCDevice.LoadLights(childLights)); } }