34 Replies
Or atleast something similar to that
A static method, yes
A non-static method, no
But why do you want to do that here? You can just get the value from this method and print that
I'm just messing around and trying to learn things
not for any particular reason
That's not exactly true, as long as you have an instance.
mtreit#6470
REPL Result: Success
Console Output
Compile: 564.016ms | Execution: 73.617ms | React with ❌ to remove this embed.
Huh
TIL
Thought
Func
s and Action
s need to be staticNope 🙂
isn't that basically what I'm doing?
not sure why it might not be working for me
Paste your full code
You're invoking
aMethod
With the ()
after the nameSo
var method
is the thing that aMethod()
returns, not aMethod
itself
You want var method = Object.aMethod;
(note the lack of parentheses)Oh I see
i'm basically doing () twice
Presumably that code doesn't even compile since aMethod takes an int and you aren't passing one
although it's telling me this now
Are you using .NET Framework?
I started assuming everybody with the green mark next to their name is using Framework lol
Microsoft should really hid the
(.NET Framework)
templates from VSLegacy codebases are a huge part of the ecosystem
Legacy stuff is already on Framework, no new projects to be made
Besides, not saying remove it completely, just slap it into some "show more" dropdown
I agree if you are creating brand new .NET Framework projects that will not be referenced by other .NET Framework projects you should reconsider your life choices.
it's not vs
it's w3schools code executer lol
Why
if i'm going to use vs, what template should I use if I just want to mess around and run random things?
$newproject
When creating a new project, prefer using .NET over .NET Framework, unless you have a very specific reason to be using .NET Framework.
.NET Framework is now legacy code and only get security fix updates, it no longer gets new features and is not recommended.
https://cdn.discordapp.com/attachments/569261465463160900/899381236617855016/unknown.png
sick
The console will be good for starters
If you use $code (not screenshots) to paste your exact source code that is failing it will be a lot more clear what the issue you are seeing is.
To post C# code type the following:
```cs
// code here
```
Get an example by typing
$codegif
in chat
If your code is too long, post it to: https://paste.mod.gg/what's the difference between WPF application and console application?
WPF has all the windows and buttons and text inputs and stuff
Console is... console
Just the text
GitHub
gui.cs
Modern, cross-platform, terminal UIs since 2007. gui.cs has 6 repositories available. Follow their code on GitHub.
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.