You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Suggestion #1: HttpClient is intended to be reused, instead of creating multiple instances for a request, you can use one HttpClient instance to handle multiple asynchronous requests
Line:
Suggestion #2:
The ToEvent method looks brittle, it uses long.Parse which will through various exceptions in certain cases, there are no sanity checks performed to see if the string is a correct Int64 and if it contains content. It may be good to use TryParse(string, out long);
Line:
Suggestion #3:
Instead of concatenating the URL you could use a UriBuilder to do this for you, and pass a Uri object to your GetX methods. Using a Uri object will add an extra bit of sanity that says this is a correct URL before it gets as far as attempting to send a request.
Line:
Suggestion #1:
HttpClient
is intended to be reused, instead of creating multiple instances for a request, you can use oneHttpClient
instance to handle multiple asynchronous requestsLine:
Looker/Looker/Looker/Program.cs
Line 29 in 4271012
Suggestion #2:
The
ToEvent
method looks brittle, it useslong.Parse
which will through various exceptions in certain cases, there are no sanity checks performed to see if the string is a correct Int64 and if it contains content. It may be good to useTryParse(string, out long);
Line:
Looker/Looker/Looker/Program.cs
Line 50 in 4271012
Suggestion #3:
Instead of concatenating the URL you could use a
UriBuilder
to do this for you, and pass aUri
object to yourGetX
methods. Using aUri
object will add an extra bit of sanity that saysthis is a correct URL
before it gets as far as attempting to send a request.Line:
Looker/Looker/Looker/Program.cs
Line 23 in 4271012
Suggestion 4:
It isn't necessary to use an
@
symbol when indexing your deserializedJObject
Suggestion 5:
It is safer to deserialize to a strong object instead of indexing on key names, spelling mistakes could happen.
The text was updated successfully, but these errors were encountered: