This is the controller:
public ActionResult Index()
{
var result = from u in myContext.Users
join g in myContext.Groups
on u.gid equals g.id
select new {
u.username,
g.name
};
return View(result );
}
This is the View
@model IEnumerable<eTravel1.Models.User>
...
@Html.DisplayNameFor(model => model.username)
@Html.DisplayNameFor(model => model.name)
..
The returned anonymous data is not compatible in the View. I would really apreciate it if someone could give some advice. Thanks