I have used entity data model wizard to create an entity framework for my tables in the SQL server however I need to use more than two models in my razor view within MVC, currently I have an existing linq query in :
Controller View
var test = from a in db.tbl_users
where a == 2
select a;
return view (test.ToList());
Razor View:
@model IEnumerable <Telephone_Search.Models.tbl_users>
@foreach (var item in model)
@HTML.DisplayFor(modelItem => item.users)
However I plan to access other tables which exist in the Entity Framework which I want loop through, something like this
@model IEnumerable <Telephone_Search.Models.'EntityFramework'>
@foreach (var item in 'entityframework')
@HTML.DisplayFor(modelItem => EntityFramework.'table'.'item')
I have tried to create a view modal however my classes are separated within the model folder and I'm not sure how to wrap these classes into one view model?