I have a controller which peforms a linq to sql query against a model consiting of 4 tables.
var files = from f in filesContext.Files
join u in filesContext.aspnet_Users on f.Uploader equals u.UserId
join uir in filesContext.aspnet_UsersInRoles on u.UserId equals uir.UserId
join ur in filesContext.aspnet_Roles on uir.RoleId equals ur.RoleId
select f;
I then return the view passing files variable as the model.
In the view I currently have:
Inherits="System.Web.Mvc.ViewPage<IEnumerable<Bailiffs.Models.File>>"
This is fine until I want to access columns from any other table except Files e.g. aspnet_Users or aspnet_Rols. I guess this is because my view knows nothing of those models. How can i gain access to those models in my view?