public async Task SaveUserAssociation(ProcessIdToUserAssociation r) { using var db = GetConnection(); db.Open(); var query = @"INSERT INTO processidtouserassociations (id, userId, timestamp) VALUES (:id, :userId, :timestamp)"; await db.ExecuteAsync(query, new { r.Id, userId = r.UserId, timestamp = r.Timestamp }); }
public async Task ProcessIdToUserAssociationsWork() { var storage = GetStorage(); var r = new ProcessIdToUserAssociation(Guid.NewGuid(), DateTimeOffset.UtcNow); await storage.SaveUserAssociation(r); var fromDb = await storage.GetUserAssociation(r.Id); Assert.Equal(r.UserId, fromDb.UserId); }
public async Task SaveUserAssociation(ProcessIdToUserAssociation r) { var db = _redis.GetDatabase(); await db.HashSetAsync( "passwordreset:" + r.Id, new StackExchange.Redis.HashEntry[] { new StackExchange.Redis.HashEntry("id", r.Id.ToString()), new StackExchange.Redis.HashEntry("userid", r.UserId.ToString()), new StackExchange.Redis.HashEntry("timestamp", r.Timestamp.ToString()), } ); }
public Task SaveUserAssociation(ProcessIdToUserAssociation r) { throw new NotImplementedException(); }