/// <summary> /// Copies this instance into another /// </summary> /// <param name="other"></param> /// <returns></returns> public void CopyTo(UserSessionUpdate other) { other.SubjectId = SubjectId; other.SessionId = SessionId; other.Created = Created; other.Renewed = Renewed; other.Expires = Expires; other.Ticket = Ticket; }
/// <inheritdoc/> public async Task UpdateUserSessionAsync(string key, UserSessionUpdate session) { var items = await _sessionDbContext.UserSessions.Where(x => x.Key == key).ToArrayAsync(); var item = items.SingleOrDefault(x => x.Key == key); if (item != null) { session.CopyTo(item); await _sessionDbContext.SaveChangesAsync(); } else { _logger.LogDebug("No record found in user session store when trying to update user session for key {key}", key); } }