public virtual Task CreateAsync(IdentityRole role)
        {
            if (role == null)
            {
                throw new ArgumentNullException("role");
            }

            using (var db = _context.OpenDbConnection())
            {
                db.Insert(role);
                return(Task.FromResult(0));
            }
        }
        public virtual Task AddLoginAsync(IdentityUser user, UserLoginInfo login)
        {
            if (user == null)
            {
                throw new ArgumentNullException("user");
            }

            if (login == null)
            {
                throw new ArgumentNullException("login");
            }
            var userLogin = new IdentityUserLogin <string>()
            {
                UserId        = user.Id,
                ProviderKey   = login.ProviderKey,
                LoginProvider = login.LoginProvider
            };

            using (var db = _context.OpenDbConnection())
                db.Insert(userLogin);

            return(Task.FromResult(0));
        }