您好,我在控制器类中有这个 lambda 表达式,我只想取模
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());
风景
@model IEnumerable<Models.Modulos>
错误是:
传入字典的模型项的类型为“System.Collections.Generic.List
1[<>f__AnonymousType6
1[Models.Modulos]]”,但此字典需要类型为“System.Collections.Generic.IEnumerable`1[Models.Modulos”的模型项]'
任何人都可以帮助我吗??谢谢