-
Notifications
You must be signed in to change notification settings - Fork 15
AQ56DX - Weather #9
base: main
Are you sure you want to change the base?
Conversation
…WeatherStringBuilder which formats data. Added WeatherIO json file writer. Added get all, get today, refresh commands.
{ | ||
public static async Task<string> GetWeatherDataAsync() | ||
{ | ||
HttpClient client = new HttpClient(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A HttpClient IDisposable, szóval egy using blokk-ban lenne érdemes használni, mert memory leakelni fog.
|
||
namespace Weather.Controllers | ||
{ | ||
internal class WeatherReportStringBuilder |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Az elnevezés nem a legszerencsésebb. StringBuilder a név suffix, de nem öröklődsz az eredeti StringBuilder-ből. A név alapján meg feltételezném, hogy ez helyettesíthető a StringBuilder helyére, közben nem.
[Serializable] | ||
internal sealed record ModelMain | ||
{ | ||
public float temp { get; set; } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
JsonName attribútummal C# kompatibilisabbá lehetett volna tenni a property neveket :)
|
||
namespace Weather.Models | ||
{ | ||
[Serializable] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A Serializable attribútum csak olyan osztályokra kell, amiket Binárisan is akarsz szerializálni, régen ajánlás volt, hogy tedd ki, de mivel a Binary serializer már elavult és rajta kívül semmi nem eszi meg a Serializable attribútumot, így nem sokat ad hozzá.
{ | ||
Console.WriteLine($"Something went wrong during processing youre action: {e.Message}"); | ||
} | ||
await Task.Delay(1000); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Szerencsésebb lett volna egy "Press key to exit" és Console Readkey() használata, hogy tényleg el lehetessen olvasni a kimenetet kilépés előtt.
@@ -0,0 +1,27 @@ | |||
using System; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Összességében szép munka. Pár apró komment amibe bele tudtam kötni, de tényleg szép. Well done.
Prisóczki Szilárd (AQ56DX) weather API console application with c#.