This is my object structure,
Group has
List of Offers
Offer has
GroupId
List of Products
How can I add a product to the already existing List of products based on Group ID
This code is adding the Product but overwriting the existing product
Group.OffersList.Where(x => x.GroupId == "1")
.SelectMany(x => x.ProductList)
.ToList().Add(Product);
1 Answer