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

Posted by GenericTypeTea on Stack Overflow See other posts from Stack Overflow or by GenericTypeTea
Published on 2010-05-08T20:32:45Z Indexed on 2010/05/08 20:38 UTC
Read the original article Hit count: 153

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?

© Stack Overflow or respective owner

Related posts about c#

Related posts about mvc