c# - Nested ILookup - Argument ype error -
consider following object:
class menu{ public int section {get; set;} public string parent {get; set;} public string name {get; set;} public string url {get; set;} /* more */ }
i getting list of these objects , want group them section , inside each section want group them parent used following structure:
ilookup<int, ilookup<string, menu>> menustructure = menulist.tolookup(m => m.section, menulist.tolookup(m => m.parent));
but i'm getting error:
cannot implicitly convert type 'system.linq.ilookup<int,mynamespace.menu>' 'system.linq.ilookup<int,system.linq.ilookup<string,mynamespace.menu>>'. explicit conversion exists (are missing cast?)
what doing wrong?
Comments
Post a Comment