Teddy
Teddy
CC#
Created by Victor on 11/16/2023 in #help
Blazor App - Websocket connection is lost after a while
https://www.twitch.tv/videos/1977263472 (Starts at 1h34m - from .NET Conf)
4 replies
CC#
Created by Victor on 11/16/2023 in #help
Blazor App - Websocket connection is lost after a while
The new Blazor in .NET 8 doesn't use web socket for form submission FYI.
4 replies
CC#
Created by Victor on 11/16/2023 in #help
Blazor App - Websocket connection is lost after a while
Not that I'm aware of, it's a similar issue to web apps that have a like 30 minute timeout, and if the tab isn't in focus you might come back to the page and it'll say "logging out in 30 seconds" unless you click whatever button, but it reality, it's already expired and you've already been logged out, so clicking the button won't save the session.
4 replies
CC#
Created by h0la on 11/6/2023 in #help
✅ WPF vs. Avalonia
If you need xplat, Avalonia is a decent option, if not, up to you.
6 replies
CC#
Created by h0la on 11/6/2023 in #help
✅ WPF vs. Avalonia
Nope, you've pretty much got it covered.
6 replies
CC#
Created by krfx on 11/6/2023 in #help
✅ whats wrong?
you can use int input = int.Parse(Console.ReadLine()); but like @sinfluxx said, TryParse would be better, because what if they don't enter a whole number, or spaces on the end, letters, etc.
5 replies
CC#
Created by Richards on 11/6/2023 in #help
✅ loop do while
To expand further. number = Convert.ToInt32(Console.ReadLine()); They enter 6, you've stored 6 to number, so the first number printed is 6
6 replies
CC#
Created by Exi on 10/5/2023 in #help
❔ BlazorWASM Multi-Tenant Application - Struggle with changing DbContext while Runtime
If you have any other questions #web is a great place to chat about this stuff too.
8 replies
CC#
Created by Exi on 10/5/2023 in #help
❔ BlazorWASM Multi-Tenant Application - Struggle with changing DbContext while Runtime
The issue you're running into is related to the lifetime of Blazor WASM services, which scoped is effectively singleton, so you're using the same service for the lifetime of the application. https://learn.microsoft.com/en-us/aspnet/core/blazor/fundamentals/dependency-injection?view=aspnetcore-7.0#service-lifetime
8 replies
CC#
Created by Exi on 10/5/2023 in #help
❔ BlazorWASM Multi-Tenant Application - Struggle with changing DbContext while Runtime
I know this isn't your question, but it's a really bad idea to put your database connection into a client-side application. Anyone who uses it will have access to the connection string.
8 replies
CC#
Created by mixels on 7/5/2023 in #help
❔ Specify timezone of DateTime converted from localized timestamp without changing the time?
If you can get away with the client doing local time conversions, that's always the ideal.
10 replies
CC#
Created by mixels on 7/5/2023 in #help
❔ Specify timezone of DateTime converted from localized timestamp without changing the time?
UTC whenever possible 💯 , but yeah, I understand there's instances where a backend needs to calculate/use local times, like banking.
10 replies
CC#
Created by mixels on 7/5/2023 in #help
❔ Specify timezone of DateTime converted from localized timestamp without changing the time?
Just don't forget about daylight savings if applicable. As in, if figuring out a future date at specific local time, it might swap from Eastern Standard to Eastern Daylight.
10 replies
CC#
Created by krixsick on 6/26/2023 in #help
❔ C# Error with a while loop (course work)
while (true)
{
if (i % 3 == 0)
{
i++;
continue;
}
else if (i == 10)
{
break;
}
Console.WriteLine(i++); <---
if (i == 11)
{
...
}
Console.WriteLine(i++); <---
}
while (true)
{
if (i % 3 == 0)
{
i++;
continue;
}
else if (i == 10)
{
break;
}
Console.WriteLine(i++); <---
if (i == 11)
{
...
}
Console.WriteLine(i++); <---
}
The incrementing of i twice in a given loop
12 replies
CC#
Created by LPeter1997 on 5/24/2023 in #help
❔ Decent terminal UI library or solution
35 replies