/gist:d89d9c0849478036d208 Secret
Created
July 12, 2015 17:28
part 4 updating a list of users in mongodb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
static void UpdateUsers(IList<User> users) | |
using (IUserStore userStore = new MongoDBUserStore(ConnectionString, DatabaseName, CollectionName)) | |
{ | |
userStore.Start(); | |
foreach (User user in users) | |
{ | |
User updatedUser = user.Mutate(b => | |
{ | |
b.Password = // pick a random string from somewhere here | |
return b; | |
}); | |
userStore.Put(updatedUser); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment