Hello I have this lambda expression in controller class, and i want to take only modulos to
return PartialView( db.AcessosUsuarios
.Join(db.Perfils,
Au => Au.IdPerfil,
p => p.IdMenu,
(Au, p) => new { AcessosUsuarios = Au, Perfils = p })
.Where(x => x.AcessosUsuarios.IdUsuario == Usu)
.Join(db.Menus,
p => p.Perfils.IdPerfil,
Me => Me.IdMenu,
(Me, p) => new { Menus = Me, Perfils = p })
.Join(db.Modulos,
Me => Me.Menus.Perfils.IdMenu,
Mo => Mo.IdModulo,
(Me, Mo) => new { Modulos = Mo, Menus = Me, Me.Menus.Perfils.IdMenu })
.OrderByDescending(Mod => Mod.Modulos.Ordem)
.Join(db.AcessosAssinantes,
Mo => Mo.Modulos.IdModulo,
Aa => Aa.IdModulo,
(Mo, Aa) => new { Modulos = Mo, AcessosAssinantes = Aa })
.Where(y => y.AcessosAssinantes.IdAssinante == Ass)
.Select(s => new { s.Modulos.Modulos})
.ToList().AsEnumerable());
the view
@model IEnumerable<Models.Modulos>
the error is :
The model item passed into the dictionary is of type 'System.Collections.Generic.List
1[<>f__AnonymousType61[Models.Modulos]]', but this dictionary requires a model item of type 'System.Collections.Generic.IEnumerable`1[Models.Modulos]'
Anyone can help me?? Thanks