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

java - HTTP Status 500 - An exception occurred processing JSP page /second.jsp at line 15 -

php - Using str_replace to translate a MySQL Table in html -

SQL Server - MyCTE query based on 24 hour period (next day) -