entity framework - Index (zero based) must be greater than or equal to zero error -


im geting next error:

index (zero based) must greater or equal 0 , less size of argument list.

and im not sure means, code:

 var gruposa = db_cm.permisos_grupo_user.include("permisos_grupo")                             .where(g => g.id_user == id && model.grupos.any(x => int.parse(x.value) == g.id_grupo))                             .tolist(); 

can tell me wath wrong?

model.grupos ienumerable<selectlistitem>

what need select list of cm.permisos_grupo_user if id on model.grupos

well, adding .tolist() fixed problem

db_cm.permisos_grupo_user.include("permisos_grupo").tolist()                             .where(g => g.id_user == id && model.grupos.any(x => int.parse(x.value) == g.id_grupo))                             .tolist(); 

Comments