Saturday, May 8, 2010

What's the correct way to instantiate an IRepository class from the Controller?

Programmer Question


I have the following project layout:



MVC UI
|...CustomerController (ICustomerRepository - how do I instantiate this?)

Data Model
|...ICustomerRepository

DAL (Separate Data access layer, references Data Model to get the IxRepositories)
|...CustomerRepository (inherits ICustomerRepository)


What's the correct way to say ICustomerRepository repository = new CustomerRepository(); when the Controller has no visibility to the DAL project? Or am I doing this completely wrong?





Find the answer here

No comments:

Post a Comment

LinkWithin

Related Posts with Thumbnails