c# - Get The Full List Of Objects In A Dictionary Values -
i have dictonary:
private dictionary<int, icar> _icarsdic;
the object icar contains list of objects:
public interface icar { int carid { get; set; } string carname { get; set; } list<ibrandsdetails> brandsdetails { get; set; } }
i write function returns me in single list brandsdetails in _icarsdic
values.
i sure linq (don't want write ugly loop) i'm new appreciate help. thanks!
list<ibrandsdetails> list = _icarsdic.selectmany(r => r.value.brandsdetails) .tolist();
Comments
Post a Comment