Microsoft.AspNet.Identity.IUserStore.FindByIdAsync(string)

Here are the examples of the csharp api class Microsoft.AspNet.Identity.IUserStore.FindByIdAsync(string) taken from open source projects. By voting up you can indicate which examples are most useful and appropriate.

2 Examples 7

1. Example

Project: diagnostics-kit
Source File: IdentityConfig.cs
public Task<User> FindByIdAsync(string userId)
        {
            return um.FindByIdAsync(userId);
        }

2. Example

Project: AspNet.Identity.RavenDB
Source File: RavenUserStoreFacts.cs
[Fact]
        public async Task Should_Retrieve_User_By_UserId()
        {
            string userName = "Tugberk";
            string userId = "RavenUsers/Tugberk";

            using (IDocumentStore store = CreateEmbeddableStore())
            using (IAsyncDocumentSession ses = store.OpenAsyncSession())
            {
                ses.Advanced.UseOptimisticConcurrency = true;
                IUserStore<RavenUser> userStore = new RavenUserStore<RavenUser>(ses);
                await ses.StoreAsync(new RavenUser(userName));
                await ses.SaveChangesAsync();

                IUser user = await userStore.FindByIdAsync(userId);

                Assert.NotNull(user);
                Assert.Equal(userName, user.UserName, StringComparer.InvariantCultureIgnoreCase);
            }
        }