Ejemplo n.º 1
0
        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 });
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
        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()),
            }
                );
        }
Ejemplo n.º 4
0
 public Task SaveUserAssociation(ProcessIdToUserAssociation r)
 {
     throw new NotImplementedException();
 }