I am trying to convert the project from here https://github.com/attilah/AngularJSAuthentication to using the mongo driver version 2 the latest one so I can adapt to my current project.
I nearly completed of my migration but I face with a few files which I dont know how to convert , because I new comming into the web api 2 and mongodb .
The problem which I am facing problem are:
- ApplicationIdentityContext.cs
- ApplicationUserManager.cs
- ApplicationRoleManager.cs
For example with ApplicationIdentityContext.cs I have tried as the following code, but does error appear and I get stuck on this point:
namespace AngularJSAuthentication.API
{
using Entities;
using Microsoft.AspNet.Identity.EntityFramework;
using MongoDB.Driver;
public class ApplicationIdentityContext : IdentityDbContext
{
public ApplicationIdentityContext(IMongoContext mongoContext)
: this(mongoContext.Users, mongoContext.Roles)
{
}
public ApplicationIdentityContext(IMongoCollection<User> users, IMongoCollection<Role> roles)
: base(users, roles)
{
}
}
}
and then the editor show me error when I build the program :
Severity Code Description Project File Line Suppression State
Error CS1503 Argument 1: cannot convert from 'MongoDB.Driver.IMongoCollection<AngularJSAuthentication.API.Entities.User>' to 'System.Data.Common.DbConnection' AngularJSAuthentication.API D:\Projects\AngularJSAuthentication-master\AngularJSAuthentication.API\ApplicationIdentityContext.cs 14 Active
Here is my repos: https://github.com/skanel/Angular2-WebApi2-Mongodb2-Authentication
Do you have any idea?