Answer by Bogdan Banciu for Unity DI with MVC 5 in controllers
you can try thispublic class ToolbarControllerContext{ [Dependency] public IToolbarLogic ToolbarLogic { get; set; }}public class ToolbarController : BaseController{ private readonly IToolbarLogic...
View ArticleAnswer by Sulay Shah for Unity DI with MVC 5 in controllers
The unity config is missing with the mapto registration entry that it will use to resolve the configuration<container><register type="MyService"> ... </register> <!-- Default...
View ArticleAnswer by Nkosi for Unity DI with MVC 5 in controllers
From the comments in your code it is indicated that there is a unity config file.Calling container.LoadConfiguration(); after configuration in code will override any matching type registration from the...
View ArticleAnswer by Aboc for Unity DI with MVC 5 in controllers
Try to replace the constructor of your controller by the following:public ToolbarController(IToolbarLogic toolbarLogic){ this.ToolbarLogic = toolbarLogic;}
View ArticleUnity DI with MVC 5 in controllers
I'm currently having issues when trying to make a dependency injection inside a MVC controller.The current exception is the following:The current type, myproject.Core.ToolbarLogic, is an interface and...
View Article
More Pages to Explore .....