Sonath
Sonath
CC#
Created by Mathall on 7/1/2024 in #help
possible null reference warning
but in general Pobiega's response is better, because it provides more details on the user regarding what went wrong
36 replies
CC#
Created by Mathall on 7/1/2024 in #help
possible null reference warning
the warning disappears if you start your if statement with the null check first, because it assumes that if it's true the 2nd boolean statement doesn't have to be checked.
if (string.IsNullOrEmpty(input) || !input.All(char.IsLetterOrDigit))
if (string.IsNullOrEmpty(input) || !input.All(char.IsLetterOrDigit))
36 replies
CC#
Created by Sonath on 1/8/2024 in #help
✅ Opinion time: Handling multiple id's in the same path (ASP.NET MVC)
I'm so new in MVC it hurts
7 replies
CC#
Created by Sonath on 1/8/2024 in #help
✅ Opinion time: Handling multiple id's in the same path (ASP.NET MVC)
I think I'll keep the 2 controllers separate because it's an issue with naming the CRUD paths, given that they're both within the same area. So they have paths like AreaName/surveys/1/submissions/create but I also need an AreaName/surveys/create, and having them both on the same controller will mess up the pattern recognition system for areas 😭
7 replies
CC#
Created by Sonath on 1/8/2024 in #help
✅ Opinion time: Handling multiple id's in the same path (ASP.NET MVC)
thank you, I'll check it out. I'm trying to avoid relying on TempData because right now I'm using it as a place that stores the survey Id to carry it over to the other controller
7 replies
CC#
Created by Sonath on 11/27/2023 in #help
Why does the following prints "Point" to the console instead of "(2, 3)"?
it really threw me off cause I always believed that it just executes whatever .ToString exists on the object that's passed, but since it's using object internally it makes sense!
6 replies
CC#
Created by Sonath on 11/27/2023 in #help
Why does the following prints "Point" to the console instead of "(2, 3)"?
alright thank you 😄
6 replies
CC#
Created by Sonath on 10/27/2023 in #help
✅ Need a good resource to learn how to build .NET Core Web API's
14 replies
CC#
Created by Sonath on 10/27/2023 in #help
✅ Need a good resource to learn how to build .NET Core Web API's
and authentication, right?
14 replies
CC#
Created by Sonath on 10/27/2023 in #help
✅ Need a good resource to learn how to build .NET Core Web API's
I need to - get a feel of what to expect on my first job - demonstrate my understanding of best practices - put it on my portfolio In no specific order 😰
14 replies
CC#
Created by Sonath on 10/26/2023 in #help
✅ Recommended way to handle null results from a repository GET action?
yeah I think I agree with Pobiega, I'll remove the conditional checking and handle it differently
35 replies
CC#
Created by Sonath on 10/26/2023 in #help
✅ Recommended way to handle null results from a repository GET action?
the consumer may query for a company that doesn't exist
35 replies
CC#
Created by Sonath on 10/26/2023 in #help
✅ Recommended way to handle null results from a repository GET action?
yeah so, basically the custom exception does that, I just think that (after talking with others too) it's better NOT to throw an exception here, and reserve exceptions for really exceptional things.
35 replies
CC#
Created by Sonath on 10/26/2023 in #help
✅ Recommended way to handle null results from a repository GET action?
ah sorry it's a Web API
35 replies
CC#
Created by Sonath on 10/26/2023 in #help
✅ Recommended way to handle null results from a repository GET action?
Or is it not necessary? 👀
35 replies