In my Controller, I've added code to execute and retrieve for two stored procedures:
public ActionResult Index()
{
ViewBag.Message = "Modify this template to jump-start your ASP.NET MVC application.";
var megaMean = _db.GetMegaMillionsMean();
var powerMean = _db.GetPowerballMean();
//object mega = null;
List<mega> viewMega = megaMean.Select(p => new mega {ball1 = p.Ball_1_Average, ball2 = p.Ball_2_Average, ball3 = p.Ball_3_Average, ball4 = p.Ball_4_Average, ball5 = p.Ball_5_Average, megaball = p.MegaBall_Average}).ToList();
List<power> viewPower = powerMean.Select(p => new power { ball1 = p.Ball_1_Average, ball2 = p.Ball_2_Average, ball3 = p.Ball_3_Average, ball4 = p.Ball_4_Average, ball5 = p.Ball_5_Average, powerball = p.Powerball_Average }).ToList();
return View(viewMega);
}
Currently I'm only able to pass one set of those results to my view:
@{
foreach (var item in Model )
{
<tr>
<td>
@item.ball1
</td>
<td>
@item.ball2
</td>
<td>
@item.ball3
</td>
<td>
@item.ball4
</td>
<td>
@item.ball5
</td>
<td>
@item.megaball
</td>
</tr>
Is there away that I can pass both of those stored procedure results to one view? Or at least any way that I can achieve this another way? Thanks!