Beispiel #1
0
        //
        // Summary:
        //     Adds a user login with the specified provider and key
        //
        // Parameters:
        //   user:
        //
        //   login:
        public async Task AddLoginAsync(TUser user, UserLoginInfo login)
        {
            await m_userLoginTable.CreateAsync(new UserLogin(user.Id, login.LoginProvider, login.ProviderKey));

            await m_lookupTable.CreateAsync(new LookupInfo()
            {
                PartitionKey = "LoginProvider_" + login.LoginProvider, RowKey = login.ProviderKey, UserId = user.Id
            });
        }
Beispiel #2
0
 /// <summary>
 /// Insert a new User
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 public async Task CreateAsync(TUser user)
 {
     await m_userTable.CreateAsync(user);
 }
Beispiel #3
0
 //
 // Summary:
 //     Add a new user claim
 //
 // Parameters:
 //   user:
 //
 //   claim:
 public async Task AddClaimAsync(TUser user, Claim claim)
 {
     await m_userClaimTable.CreateAsync(new UserClaim(user.Id, claim.Type, claim.Value));
 }
Beispiel #4
0
 //
 // Summary:
 //     Adds a user to a role
 //
 // Parameters:
 //   user:
 //
 //   roleName:
 public async Task AddToRoleAsync(TUser user, string roleName)
 {
     await m_userRoleTable.CreateAsync(new UserRole(user.Id, roleName));
 }
Beispiel #5
0
 //
 // Summary:
 //     Create a new role
 //
 // Parameters:
 //   role:
 public async Task CreateAsync(TRole role)
 {
     await m_roleTable.CreateAsync(role);
 }