I've been working through the NerdDinner Tutorial and most of it makes sense. What I'm not sure about is why the Repository is used directly in the Controller and not the Model objects. For instance, if we wanted to implement our own membership system and it had an AccountController with a Login method, what would be the best solution for hooking it up? e.g.

```
Login(username,password){

    repo = AccountRepository

    account = repo.getLogin(username,password)

    //check account isn't locked

    //check account has been verified etc etc 

    //throw error or proceed to secure area

}

```

OR

```
Login(username,password){

    repo = AccountRepository

    account = repo.getLogin(username,password)

    account.login() //business logic is handled in Account (Model)

}

```

OR

```
Login(username,password){

    //no reference to repository

    account = Account

    //Account (Model) uses repository and handles business logic
    account.login(username,password) 

}

```

I'm suggesting having the Account object use the AccountRepository directly, instead of the AccountController getting the information from the AccountRepository and then passing it to the Account object e.g.

NerdDinnner style:

1 Login request comes in  

2 AccountController uses AccountRepository to get login details based on request  

3 AccountController uses Account object and passes in info from step 1  

4 Account object processes request and notifies AccountController 

What I'm suggesting:

1 Login request comes in  

2 AccountController uses Account object to process login based on request  

3 Account object uses AccountRepository to get login details  

4 Account object processes request and notifies AccountController 

The reason for the latter style is that after login details are returned from the AccountRepository there would be business rules to follow e.g. is account locked, is account verified etc If the first style is used the logic for getting the details and then using them is split over 2 steps. The latter style keeps all the logic together while still using the AccountRepository e.g.

```
Account.Login(username,password){
    repo = AccountRepository

    account = repo.GetLogin(username,password)

    //check account isn't locked

    //check account has been verified etc etc

    //throw error or proceed to secure area
}

```

I hope that makes sense.