SleepWellPupper
SleepWellPupper
CC#
Created by VoidPointer on 11/8/2024 in #help
✅ How to specify camel case for all response properties with Newtonsoft
Seconding the viability voncerns about converters: Notice that camelCase AND snake_case are being used.
11 replies
CC#
Created by Wrenpo on 11/5/2024 in #help
Safely getting a result from a async method within a sync method
I'd like to know why the method needs to be synchronous @Wrenpo
37 replies
CC#
Created by Wrenpo on 11/5/2024 in #help
Safely getting a result from a async method within a sync method
This I agree with.
37 replies
CC#
Created by Wrenpo on 11/5/2024 in #help
Safely getting a result from a async method within a sync method
Op specified
capture any possible exceptions
async void does not do that, async Task does. There is no relevant upside to using async void over async Task for this. ContinueWith might as well be implemented using async/await
37 replies
CC#
Created by Wrenpo on 11/5/2024 in #help
Safely getting a result from a async method within a sync method
37 replies
CC#
Created by Wrenpo on 11/5/2024 in #help
Safely getting a result from a async method within a sync method
If they want to synchronously block await on a task, then .Result will do (caveats like deadlock risks apply, of course), if they don`t, then just throw away the task.
37 replies
CC#
Created by Wrenpo on 11/5/2024 in #help
Safely getting a result from a async method within a sync method
I'd ask you kindly not to assume what I read please. I did read your message but none of what OP presented requires async void.
37 replies
CC#
Created by Wrenpo on 11/5/2024 in #help
Safely getting a result from a async method within a sync method
Why use async void (risky) over async Task (not risky)?
37 replies
CC#
Created by junex(zoro>light&dark) on 11/6/2024 in #help
Java to C#
Right so you will write backend stuff in dotnet, you should be looking at ASP.net core web apis and C# in general. Why do you want to migrate your project? Is it for work?
11 replies
CC#
Created by Jabka on 11/3/2024 in #help
Help. Broken Rust plugin
no Use $paste
15 replies
CC#
Created by Wrenpo on 11/5/2024 in #help
Safely getting a result from a async method within a sync method
make it async void
There is absolutely no need for this in the code OP shared; this is genuinely bad advice. Unless you are writing event handlers for a UI framework dictating a void returning handler, you should not use async void.
37 replies
CC#
Created by Treycos on 11/5/2024 in #help
✅ Including documentation of the STL in a custom override
Awesome
17 replies
CC#
Created by junex(zoro>light&dark) on 11/6/2024 in #help
Java to C#
So the question would be, what is your backend and how much of it do you want to rewrite (learn C#/dotnet) vs. merely being able to call into it from dotnet (via ikvm).
11 replies
CC#
Created by junex(zoro>light&dark) on 11/6/2024 in #help
Java to C#
That depends on what you mean by backend. Generally, it is possible to interop Java and C# by transpiling jar files to dlls using ikvm, a jvm for dotnet. https://github.com/ikvmnet/ikvm
11 replies
CC#
Created by Treycos on 11/5/2024 in #help
✅ Including documentation of the STL in a custom override
Where foo is Math.Min I suppose
17 replies
CC#
Created by Treycos on 11/5/2024 in #help
✅ Including documentation of the STL in a custom override
I can't verify this right now but could you try using <inheritdoc cref="foo"/> in a <remarks> section of your docs comment?
17 replies
CC#
Created by Wrenpo on 11/5/2024 in #help
Safely getting a result from a async method within a sync method
The best advice in most cases is to make your calling method async. See here : https://blog.stephencleary.com/2012/07/dont-block-on-async-code.html for an explanatikn
37 replies
CC#
Created by Tofaa on 11/4/2024 in #help
Dictionary<> Keys do not get fetched properly
Records come with generated Equals/GetHashCode implementations that should fit your needs (from what I can tell frkm your examples)
13 replies
CC#
Created by Tofaa on 11/4/2024 in #help
Dictionary<> Keys do not get fetched properly
Alternatively, if the identity of a NamespaceKey is fully determined by those 3 strings, you should look at records also.
13 replies
CC#
Created by Tofaa on 11/4/2024 in #help
Dictionary<> Keys do not get fetched properly
Implementing an EqualityComparer seems unnecessary to me in this case. Tip for OP: in VS you can generate GetHashCode and Equals implementations using the quick actions context menu when opened on the type name (put caret in type name, press ctrl+. then select generate Equals+GetHashCode)
13 replies