C
C#2y ago
vovo

❔ What do you do to avoid memory leaks in ASP.NET?

In the attachment for example my approach. Is it correct?
5 Replies
vovo
vovoOP2y ago
Angius
Angius2y ago
Dunno about memory leaks (are you even experiencing them?) but the code is, in general, not great You should inject the DbContext instead of newing it up Don't use .AddAsync() Also pretty sure you load too much data from the database, and then filter it on client side Hard to tell because you're using the ugly LINQ syntax Not sure what RestClient is either, but I assume it communicates with some API. And yet, it's not asynchronous Also weird that you deserialize numbers you get from that API as strings, and then you use Convert of all things to turn them into numbers
Matt
Matt2y ago
allinoneapiContext is a really weird name and so is Crypto_Price you shouldn't be using _ in class names, the casing already tells other devs that you've started a new word
Angius
Angius2y ago
In general, you should stick to the language's naming conventions
Accord
Accord2y ago
Was this issue resolved? If so, run /close - otherwise I will mark this as stale and this post will be archived until there is new activity.
Want results from more Discord servers?
Add your server