In my ASP.NET MVC4 Web Application I'm trying to display a table with some information from a SQL database using Entity Framework. Generating a view from the SQL table(using database firs with EF) was easy for me to do, but now I'm stuck on a more conceptual question. Right now my controller passes the list of entity objects to my view.
public ActionResult Index()
{
return View(db.APU_daily_summary_test.ToList());
}
But now I need to calculate the min and max of some of these columns in SQL. I know that I should calculate the min and max inside the model, but after that I don't know how I should pass this information through the controller to the view. Do I need a view model? An API? An extra controller?