I'm having problems to implement CodeFirstMembership provider using a unitofwork pattern.
When I tried to inject unitofwork to the constructor of custom MemberShipProvider class, always received the error: "No parameterless constructor defined for this object."
This is the code:
public class CodeFirstMembershipProvider : MembershipProvider
{
private readonly IUnitOfWork unitOfWork;
public CodeFirstMembershipProvider(IUnitOfWork unitOfWork)
{
this.unitOfWork = unitOfWork;
}
And this is webconfig section:
<membership defaultProvider="CodeFirstMembershipProvider">
<providers>
<add name="CodeFirstMembershipProvider" type="Pacific.WebUI.CustomMembership.CodeFirstMembershipProvider" connectionStringName="DataContext" />
</providers>
</membership>
The problem is, "not sure", the default implementation of MemberShipProvider is a constructor without parameters and I don't know how to inject my unitofwork class into this provider class.
Could anybody help me?