While implementing the Roleprovider so that it gets the roles from a database. I keep getting a object no instance of... exception.
As it turns out ninject does not inject my service .
I tried putting the attribuut on top of the property no succes. I tried adding a constructor but then im getting a yellow screen of death telling me there should be a parameterless constructor
The code
Public Class AnipRolProvider
Inherits RoleProvider
'this service needs to get initialized
Private _memberhip As IMemberschipService
Sub New()
'only this constructor is called by asp by default
End Sub
Sub New(memberschipservice As IMemberschipService)
'this constructor should be called but how ?
_memberhip = memberschipservice
End Sub
the only method i need
Public Overrides Function GetRolesForUser(username As String) As String()
If String.IsNullOrEmpty(username) Then
Throw New ArgumentException("username is nothing or empty.", "username")
End If
Return _memberhip.GetRolesForUser(username)
End Function
How do i implement ninjects so that role provider team up with the ninja?
Additional information :
<roleManager enabled="true" defaultProvider="AnipRoleProvider">
<providers>
<clear/>
<add name="AnipRoleProvider" type="Anip.Core.AnipRolProvider" />
</providers>
</roleManager>
in my web.config there is a reference to aniproleprovider.
offtopic-sidenote : while copying these snipsets i should learn to write better names!