Mam taką metodę
[HttpPost]
public ActionResult ListAll()
{
IList<ProductModel> makeQuery = new List<ProductModel>();
using (var session = NHibernateHelper.OpenSession())
{
makeQuery = session.QueryOver<ProductModel>().List();
}
return View(makeQuery);
}
dodaję sobie kilka danych do bazy i przechodzę na ten ekran jednak nic mi to nie daje. Mój widok
<table>
<tr>
<th>
@Html.DisplayNameFor(model => model.ProductName)
</th>
<th></th>
</tr>
@foreach (var item in Model) {
<tr>
<td>
@Html.DisplayFor(modelItem => item.ProductName)
</td>
</tr>
}
</table>
Gdy daję sobie w kontrolerze ViewBag.Zmienna i wrzucam ją za model w widoku wyswietlane jest tyle pustych miejsc ile mam rekordów w bazie.
W czym może być problem?
Pozdrawiam
Johny