In the PresenceTracker.cs class, the lookup for the username in the OnlineUsers dictionary is improved by using TryGetValue instead of ContainsKey, which prevents two lookup operations and enhances performance.
In the TokenService.cs, the new keyword was used in a more simplified manner which makes the code cleaner and easier to understand.
In the PhotoService.cs, the using var stream statement was replaced with await using var stream. This change ensures that the stream is disposed asynchronously, improving the performance of the API when uploading photos.
In the PresenceTracker.cs class, the lookup for the username in the OnlineUsers dictionary is improved by using TryGetValue instead of ContainsKey, which prevents two lookup operations and enhances performance.
In the TokenService.cs, the new keyword was used in a more simplified manner which makes the code cleaner and easier to understand.
In the PhotoService.cs, the using var stream statement was replaced with await using var stream. This change ensures that the stream is disposed asynchronously, improving the performance of the API when uploading photos.