I am implementing ASP.NET Identity via RavenDB and try to add roles to my user. https://github.com/ILMServices/RavenDB.AspNet.Identity/blob/master/RavenDB.AspNet.Identity/UserStore.cs
This implementation has the following overload available public Task AddToRoleAsync(TUser user, string role)
The ApplicationUserManager
is derived from UserManager
but I am unable to reach the overload. The only method available is the base method AddToRoleAsync(string UserId, string role)
.
The Store property is a public property in the UserManager base class, so it doesn't look anything special is going on there.
I also tried doing a direct call to manager.Store.AddToRoleAsync
but again I am not getting the overloaded method back with intellisense.
I hope someone can guide me in the right direction, really stuck here.
And then ofcourse my controller inherits this issue, and this started my search to why this is happening.
In Reponse to CodeNotFound, here is the ApplicationUser. It is quite simple.
public class ApplicationUser : IdentityUser, IEntity
{
public string FirstName { get; set; }
public string LastName { get; set; }
public DateTime Created { get; set; }
public DateTime Modified { get; set; }
public async Task<ClaimsIdentity> GenerateUserIdentityAsync(UserManager<ApplicationUser> manager)
{
// Note the authenticationType must match the one defined in CookieAuthenticationOptions.AuthenticationType
var userIdentity = await manager.CreateIdentityAsync(this, DefaultAuthenticationTypes.ApplicationCookie);
// Add custom user claims here
return userIdentity;
}
}