surwren
Explore posts from serversRefactoring Similar Network Requests
I have 3 async methods with a great deal of similarities but some differences (some use Authorization token, some have Json payload, some return Task<bool>, others Task) but all make network requests in a similar flow.
What is an approach I could use to refactor them?
93 replies
Deployment vs production environments
I am preparing for a .NET role and am wondering what some configurations/setups/tools I can look up or prepare for?
For context:
The company is using .NET and Azure. Development is done via login to a VMware portal (IDE and environment are setup inside said VM) and there are a series of CICD tools facilitating any code pushes within said VMware portal.
What deployment/production configurations or tools should I look into?
3 replies
What are some tools or methods for debugging microservices?
I am considering a microservices developer role and was wondering what some tools or strategies to debugging microservices are.
My friends told me to 'just do monolithic', but there has to be a way right? Not everyone uses monolithic and microservices are good job experience?
13 replies
✅ "Legacy Versions" of C# or .NET?
As per title, I was wondering what would be considered legacy stacks when looking up companies.
I am aware of what the Java equivalent tends to be (Java 6-8, JSP, etc) but I am unfamiliar with what indicators there are for legacy C# or .NET stacks in the industry. Is anyone able to provide some insight?
17 replies
How to check bandwidth of websocket connection?
As per title. I'm currently using websocket-sharp, but I'm wondering if there is a universal way to do it.
I am thinking of sending 5 * 30 fps data (so basically 150 fps) and don't know if my websocket connection can handle it.
4 replies
❔ The view 'GetModel1' was not found
Why is this happening?
I'm trying to call an async method (GetModel1) to access an api endpoint, which should then return the desired value to the view.
Code is as follows:
HomeController.cs:
Code for razor view:
13 replies
ASP storage use cases
So I'm aware there are several places to store data, which I will list as follows:
Serverside (application):
Sessionstate
AddSingleton
AddScoped
Clientside:
Cookies
LocalStorage
SessionStorage
I was wondering where specifically each of these 6 would be used, particularly for sessionstate, singletons and scoped?
13 replies
Why won't the second try-catch block propagate an overflowexception?
When anything over 2.147b is entered for the first try-catch block, it successfully automatically throws (and then catches) an overflowexception.
It does not need
But when anything over 2.147b is entered into the console for the second try-catch block, it does not automatically throw the overflowexception. Instead, it throws a formatexception.
The second block needs
to throw overflow. WHY?
Code below:
6 replies
When to use Null Forgiving (!) vs Non-Nullable casts
In this example, n needs to be cast from int? to int
My question is why null forgiving (!) syntax does not seem to work (new int[n!];] and where null forgiving syntax would actually be applicable.
112 replies
Casting and output
So take a basic example like
If you take the (double) cast out from num1, avg won't reflect the decimal point.
Is there a google keyword I can search for more information on how to ascertain that my numbers will be reflected as I would like them to be?
3 replies