【发布时间】:2014-03-10 12:50:10
【问题描述】:
我有一个字符串集合:
["1-","2-","4-"]
我还有一个类的集合。
类:
public class ProductionParameter
{
public string CompanyCode { get; set; }
public string UnitCode { get; set; }
public string ItemDescriptionLocal { get; set; }
public string ItemDescriptionEnglish { get; set; }
public string ConsumedItemDescriptionLocal { get; set; }
public string ConsumedItemDescriptionEnglish { get; set; }
public string LotCategory1Description { get; set; }
public string LotCategory2Description { get; set; }
public string LotCategory3Description { get; set; }
public string LotCategory1Code { get; set; }
public string LotCategory2Code { get; set; }
public string LotCategory3Code { get; set; }
public string LineCode { get; set; }
public string LineCodeDisplay { get; set; }
public string ItemUOM1 { get; set; }
public string ItemUOM2 { get; set; }
public string ConsumedItemUOM1 { get; set; }
public string ConsumedItemUOM2 { get; set; }
public string WorkShift { get; set; }
}
我想获取 LineCode 属性在字符串集合中但具有类似操作的集合的所有成员。
示例:我想检查生产参数列表中的每个类,并只保留 LineCode 属性所在的实例:
(LIKE '1-%' OR like '2-%' OR LIKE '4-%')
【问题讨论】:
-
你能完成你的问题吗?
-
请提供更多信息,问题不完整
标签: c# linq collections