views:

45

answers:

1

I'm trying to separate the default AccountModel in mvc2 into a separate interface and repository.

I've created an Interface and Repository and copied over the code from the AccountModel.

I can register users and create accounts but in Visual Studio I'm getting the error below on the AccountController (* below).

Error 1 Inconsistent accessibility: parameter type 'Admin.Models.IMembershipService' is less accessible than method 'Admin.Controllers.AccountController.AccountController(Admin.Models.IMembershipService)

public class AccountController : Controller
{
    private IMembershipService MembershipService;

    public AccountController() : this(new dao_MembershipService())
    {
    }

    public **AccountController**(IMembershipService repository)
    {
        MembershipService = repository;
    }

Does anyone know how I could fix the error?

+1  A: 

You need to make your IMembershipService interface public.

Tom Cabanski
Nice one, should have spotted that one!!
Jemes
Stupid Visual Studio defaults to creating a private interface. One of these days I will fix the template on my machine. I just know there is a way.
Tom Cabanski