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

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -