Natty
✅ 20/22 Test cases but getting TLE for last two.
https://leetcode.com/problems/lru-cache/description/?envType=list&envId=ep9peqp6
Not sure what else to optimize here. It's all O(1) calls to my knowledge...
2 replies
Code Review (Web Api)
Is this a proper set up for a web api project? If not, what should I change?
https://pastebin.com/V4ky2YXX
36 replies
❔ [FromBody] and async issues...
I have this code:
When I remove all the async stuff and make it
void
etc. then my FromBody works when deployed app in Azure environment. However, with the current code, I keep getting different JSON error messages in the console (even when using the same exact data each time). It seems like it's not getting the full data or something, like it's cut off at different parts, hence the different json error messages. Any ideas?3 replies
Updating a property and saving it to DB (EF Core)
I have a List of objects that I queried from my db context. I’m trying to change one property on it, such as:
responses.ForEach(r => r.Status = “Done”);
Then I’m calling _db.SaveChanges();
I’m not seeing the status updated in the database, am I doing something wrong?
22 replies
Clean up LINQ statements?
In an ideal situation I would just do the query on the
Cells
table, but that table gets updated with ALL the cells, each time a user uploads a file, and there wouldn't be a way to track which data they want to use then (couldn't remove the old data if it was wrong, etc).
What I have here works great, but is there a way to clean up these queries? I.E. Anyway to shorten this? Do I need all the calls here? Does calling Distinct() on each query even make sense (is that slower/faster)? etc.5 replies
❔ LINQ Question - Thought I solved it...
I have a list of dates in month/day/year format, and I've created a hashset that holds ending quarter months:
My goal is to have a bool that checks if the
allDates
only contains Quarter months (3,6,9,12). Here's what I have so far:
36 replies