Last post Jun 25, 2017 02:56 AM by JBetancourt
Member
19 Points
180 Posts
Jan 18, 2017 03:14 PM|only_you|LINK
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?
Participant
1380 Points
608 Posts
Jun 25, 2017 02:56 AM|JBetancourt|LINK
there is nothing wrong with having a reference to the data access layer in the api
take a look to onion architecture and domain driven design, those are the modern approach in opposition to the 3 layer architecture that has been around for so long.
http://jeffreypalermo.com/blog/the-onion-architecture-part-1/
Member
19 Points
180 Posts
DI concept using Structure map
Jan 18, 2017 03:14 PM|only_you|LINK
This is my implementation of Structure Map in Web Api project
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?
Participant
1380 Points
608 Posts
Re: DI concept using Structure map
Jun 25, 2017 02:56 AM|JBetancourt|LINK
there is nothing wrong with having a reference to the data access layer in the api
take a look to onion architecture and domain driven design, those are the modern approach in opposition to the 3 layer architecture that has been around for so long.
http://jeffreypalermo.com/blog/the-onion-architecture-part-1/
Please remember to click "Mark as Answer" the responsES that resolved your issue.