下面是我正在检查TransmediaTable
和过滤的代码。
我手动创建了一个案例来满足条件并给出预期的结果。但是当采取新样本时,结果会抛出异常Object reference not set to Instance of Object
。我哪里出错了。
var MissedTransmedias = XMLOperations.TransmediaTable.AsEnumerable()
.Where(x => x.Field<String>("TO_STRUCTURE_NAME").Contains("CAB:DSLAM") &&
x.Field<String>("BT_CABLE_TYPE") == "BFT" &&
string.IsNullOrEmpty(x.Field<String>("TO_EQUIPMENT_NAME")) &&
((x.Field<String>("BT_CABLE_DESIGNATION") + x.Field<String>("BT_CABLE_NUMBER")) == OnNumber))
.Select(x => x.Field<String>("TRANSMEDIA_NAME"));