开发者

AccountModel into a Repository and Interface

开发者 https://www.devze.com 2022-12-28 03:07 出处:网络
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'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())
    开发者_如何学C{
    }

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

Does anyone know how I could fix the error?


You need to make your IMembershipService interface public.

0

精彩评论

暂无评论...
验证码 换一张
取 消