lycian
lycian
CC#
Created by HiveMind on 8/16/2024 in #help
Maui + Blazor hybrid app live coding
I can say with fair certainty you're going to have a bad time in VS Code, VS probably should work
8 replies
CC#
Created by HiveMind on 8/16/2024 in #help
Maui + Blazor hybrid app live coding
it also depends on if you're using VS or VS Code
8 replies
CC#
Created by LemonDwarfG59 on 8/15/2024 in #help
Need help learning C#
I really doubt that reading documentation is a good source for first time learners
The resource itself was a learning/training track. Those should be a good starting point (although agree that a book is probably a more complete way)
16 replies
CC#
Created by PizzaWizard on 8/15/2024 in #help
Understanding COM interface references for an ASP.NET REST API...
static is important there since it becomes shared. I'm assuming no need for complex DI etc
10 replies
CC#
Created by PizzaWizard on 8/15/2024 in #help
Understanding COM interface references for an ASP.NET REST API...
roughly that, although you'll probably want some locking/concurrency checks
10 replies
CC#
Created by PizzaWizard on 8/15/2024 in #help
Understanding COM interface references for an ASP.NET REST API...
static Dictionary<string, IRemoteControl> RemoteControlMapping = new();

[HttpPost("remote-control/create")]
public IActionResult CreateRemoteControl(string userToken)
{
if (RemoteControlMapping.TryGet(userToken, out var _))
{
// handle if it already exists?
}

RemoteControlMapping[userToken] = new RemoteControl();
return OK();
}
static Dictionary<string, IRemoteControl> RemoteControlMapping = new();

[HttpPost("remote-control/create")]
public IActionResult CreateRemoteControl(string userToken)
{
if (RemoteControlMapping.TryGet(userToken, out var _))
{
// handle if it already exists?
}

RemoteControlMapping[userToken] = new RemoteControl();
return OK();
}
10 replies
CC#
Created by PizzaWizard on 8/15/2024 in #help
Understanding COM interface references for an ASP.NET REST API...
As long as you new up a new RemoteControl for each UserToken then the references are unique.
10 replies
CC#
Created by PizzaWizard on 8/15/2024 in #help
Understanding COM interface references for an ASP.NET REST API...
Whenever I send subsequent calls over a different route to do something like start/stop/reset the simulation, I'm able to do so on the most recently-spawned application instance.
If the lifetime of the ASP.NET server is tied to the spawned application instances you could easily just keep a map of user:IRemoteControl if I'm understanding your scenario correctly
10 replies
CC#
Created by LemonDwarfG59 on 8/15/2024 in #help
Need help learning C#
Keep at it, and don't hesitate to ask questions. People in this discord are here to help. Good luck!
16 replies
CC#
Created by LemonDwarfG59 on 8/15/2024 in #help
Need help learning C#
all I can say is the first fully cool project I ever made was chess in java using notepad as my text editor 😅. Would not recommend
16 replies
CC#
Created by LemonDwarfG59 on 8/15/2024 in #help
Need help learning C#
Where did you learn C#? Was it just through documentation?
I learned C# after being in industry after about 5 years. So picking up core concepts was a bit easier for me. The core concepts I learned on my own eons ago + I have a CS degree.
16 replies
CC#
Created by LemonDwarfG59 on 8/15/2024 in #help
Need help learning C#
and if you have specific questions you can always ask here
16 replies
CC#
Created by LemonDwarfG59 on 8/15/2024 in #help
Need help learning C#
I'm not super familiar with the training courses, but I believe some of it is covered in https://learn.microsoft.com/en-us/training/modules/csharp-call-methods/3-call-methods where it outlines creating an instance of a type and calling methods. If you have feedback to improve learning there's a "Feedback" at the bottom that I would suggest you use 🙂 . Unfortunately it doesn't look like these are open source like most of ms docs are
16 replies
CC#
Created by LemonDwarfG59 on 8/15/2024 in #help
Need help learning C#
interfaces are not a unique concept to C# either, so if you find resources that help understand object oriented programming concepts you can apply that to C#
16 replies
CC#
Created by LemonDwarfG59 on 8/15/2024 in #help
Need help learning C#
The learning path itself I would say is not a perfect substitute for a class like structure. If you click on things like "interface" and go to https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/keywords/interface it should help you understand what an interface is. The same for class/record/struct. If you have specific questions about any of them this is a good place to post. I would say the "working with file system" section doesn't necessarily mean you need to understand what an interface is. Instead, you can follow along and use them without fully understanding. Sometimes knowledge like that comes easier with usage than an absolute definiton.
16 replies
CC#
Created by leviathan on 8/14/2024 in #help
Adding a CommaToken in a code fix
SyntaxGenerator will help keep track of the tree as you make changes and avoid using wrong nodes
4 replies
CC#
Created by leviathan on 8/14/2024 in #help
Adding a CommaToken in a code fix
It's likely you'll get more traction in #roslyn since it's a fairly niche topic
4 replies
CC#
Created by Crunchy on 8/12/2024 in #help
✅ how to discord bot 101
$modix
15 replies
CC#
Created by Crunchy on 8/12/2024 in #help
✅ how to discord bot 101
or I'm just going to guess ...
15 replies
CC#
Created by Crunchy on 8/12/2024 in #help
✅ how to discord bot 101
15 replies