I have following Model Classes:
public class Promotion
{
public Offers Offers { get; set; }
}
public class Offers
{
public List<PromotionOffer> Offer { get; set; }
}
public class PromotionOffer
{
public string CategoryName { get; set; }
public List<Product> Product { get; set; }
}
public class Product
{
public string ProductName { get; set; }
}
I have Promotion object and a string allProducts.
Promotion promotion = promotion;
string allProducts = string.Empty;
I want to assign and append ProductName in allProducts where CategoryName == "Premium".
Is it possible to achieve this using a lambda expression? or will be needing a foreach loop too? Pls guide, how I can I achieve this?
ProductNameproperties? Or are you saying you want to append them all toallProducts? Or both?