@@ -36,10 +36,15 @@ public IQueryable<TUser> Users
3636
3737 public void Wipe ( )
3838 {
39- using ( IDocumentSession session = _documentStore . OpenSession ( ) )
39+ WipeAsync ( ) . GetAwaiter ( ) . GetResult ( ) ;
40+ }
41+
42+ public async Task WipeAsync ( )
43+ {
44+ using ( IDocumentSession session = _documentStore . LightweightSession ( ) )
4045 {
4146 session . DeleteWhere < TUser > ( x => true ) ;
42- session . SaveChanges ( ) ;
47+ await session . SaveChangesAsync ( ) ;
4348 }
4449 }
4550
@@ -82,7 +87,7 @@ public async Task<IdentityResult> CreateAsync(TUser user, CancellationToken canc
8287
8388 try
8489 {
85- using ( IDocumentSession session = _documentStore . OpenSession ( ) )
90+ using ( IDocumentSession session = _documentStore . LightweightSession ( ) )
8691 {
8792 session . Store ( user ) ;
8893 await session . SaveChangesAsync ( cancellationToken ) ;
@@ -100,7 +105,7 @@ public async Task<IdentityResult> UpdateAsync(TUser user, CancellationToken canc
100105 {
101106 try
102107 {
103- using ( IDocumentSession session = _documentStore . OpenSession ( ) )
108+ using ( IDocumentSession session = _documentStore . LightweightSession ( ) )
104109 {
105110 session . Update ( user ) ;
106111 await session . SaveChangesAsync ( cancellationToken ) ;
@@ -118,7 +123,7 @@ public async Task<IdentityResult> DeleteAsync(TUser user, CancellationToken canc
118123 {
119124 try
120125 {
121- using ( IDocumentSession session = _documentStore . OpenSession ( ) )
126+ using ( IDocumentSession session = _documentStore . LightweightSession ( ) )
122127 {
123128 session . Delete ( user ) ;
124129 await session . SaveChangesAsync ( cancellationToken ) ;
@@ -316,7 +321,7 @@ public async Task AddClaimsAsync(TUser user, IEnumerable<Claim> claims, Cancella
316321
317322 user . RoleClaims = userRoleClaims ;
318323
319- using ( IDocumentSession session = _documentStore . OpenSession ( ) )
324+ using ( IDocumentSession session = _documentStore . LightweightSession ( ) )
320325 {
321326 session . Store ( user ) ;
322327 await session . SaveChangesAsync ( cancellationToken ) ;
0 commit comments