/// <summary> /// Add all users with the given userids to the database with the given roles, the roles are only added /// to any roles already on the user account never removed. This makes it safe to call even if the user /// already exists. /// </summary> /// <param name="repo">The repository.</param> /// <param name="users">The users.</param> /// <param name="roles">The roles.</param> public static async Task AddUsers(this IUserEntityRepository repo, IEnumerable <User> users, IEnumerable <String> roles) { foreach (var user in users) { await repo.AddUser(user, roles); } }
/// <summary> /// Add a user with the given userid to the database with the given roles, the roles are only added /// to any roles already on the user account never removed. This makes it safe to call even if the user /// already exists. /// </summary> /// <param name="repo">The repository.</param> /// <param name="user">The user.</param> /// <param name="roles">The roles.</param> public static Task AddUser(this IUserEntityRepository repo, User user, IEnumerable <String> roles) { return(repo.AddUser(user, roles)); }