locked
DI concept using Structure map RRS feed

  • Question

  • User1827553000 posted

    This is my implementation of Structure Map in Web Api project

     public DefaultRegistry()
            {
                Scan(
                    scan =>
                    {
                        scan.TheCallingAssembly();
                        scan.WithDefaultConventions();
                        scan.With(new ControllerConvention());
                    });
                For<ITaskService>().Use<TaskService>();
                For<ITaskRepository>().Use<TaskRepository>();

    with this solution, I have reference to DataAccess layer in web api, and it's not solution I want to use.

    How to register Repositories in Busienss layer and inject it via constructor?

    Wednesday, January 18, 2017 3:14 PM

All replies