Reputation: 3528
I have a "MenuService", which uses an "MenuRepository".
When the MenuService is created, it loads correctly with the MenuRepository. Then it wants to save it in the UnityControllerFactory, but the MenuRepository in the MenuService is Nothing then (it wasn't before).
Very strange.
Does anyone has an idea why this is happening?
Some additional info: I'm using the Unity and Repository pattern. The problem happens with a partial view (for a menu), which i have included in the "HomeController", it could be relevant information, so i included this, just in case:
Function Menu() As ActionResult
Return PartialView("~\Views/Shared/_Menu.vbhtml", _MenuService.GetAllMenuItems)
End Function
Also, my partial "menu" view is like this: ~/_Menu.vbhtml
@ModelType IEnumerable(Of FacturatieMVCv2.Domain.Slave.MenuItem)
@*<div id="myslidemenu" class="jqueryslidemenu">*@
<ul>
@For Each Item In Model.Where(Function(el) IsNothing(el.HasHigherMenuItem))
@<li> @Html.ActionLink(Item.Naam,Item.Action,Item.Controller)
<ul>
@For Each SubItem In Model.Where(Function(el) el.HasHigherMenuItem.MenuItemID.Equals(Item.MenuItemID))
@<li>
@Html.ActionLink(SubItem.Naam,SubItem.Action,SubItem.Controller)
</li>
Next
</ul>
</li>
Next
</ul>
And i'm calling the partial view with:
@Html.Action("Menu","Home")
Upvotes: 0
Views: 94