public ActionResult Appointment()
{
return view(dt.sometable.ToList());
}
This is the view page where i'm using the model sent from the action. I'm using the razor tag to display the values from the model.
@model IEnumerable
@foreach (var item in Model)
{
@item.lname
}
Now. My query is. I want to send 2 entity models from my action to the view. I want to use the data from both the entity models in my view page.
Please provide a solution.
Thank you
Jignesh TrivediPosted Apr 5, 2013, 12:32 AM
To achieve this you have to create custom model and create individual property of required EF classes.
example
namespace mvcApplication.Areas.MyAreas.Models listClass2 { get; set; }
{
public class AssignModel
{
public MyEntityClass1 class1 {get;set;}
public IEnumerable
}
}
this will fill with in action method and use as model.
hope this will help you.