【发布时间】:2016-11-01 12:09:11
【问题描述】:
我想从promotionCatalogResponseRootObject 检索LineOfBusiness 属性,其中PromotionID 等于myId
public class PromotionCatalogResponseRootObject
{
public PromotionCatalogResponse PromotionCatalog { get; set; }
}
public class Promotion
{
public string PromotionId { get; set; }
public string LineOfBusiness { get; set; }
public string PromotionName { get; set; }
}
public class PromotionCatalogResponse
{
public List<Promotion> Promotion { get; set; }
}
我一开始就是这样,但我知道我做错了。请指导
string myId = "7596";
string lineOfBusiness = dataPromotionCatalog.PromotionCatalog
.Promotion.Find(p => p.LineOfBusiness);
【问题讨论】: