mindhardt
mindhardt
CC#
Created by Pedro Gil Mora on 10/7/2024 in #help
Dictionary vs switch in source generated code
Ok then, was worth checking
52 replies
CC#
Created by PIE on 10/7/2024 in #help
✅ File.WriteAllBytesAsync fails to download to bin folder with no error
Open a filestream to result file, open a stream of a web resource (with HttpClient.GetAsStreamAsync) and do source.CopyToAsync(dest)
16 replies
CC#
Created by PIE on 10/7/2024 in #help
✅ File.WriteAllBytesAsync fails to download to bin folder with no error
:thistbh: Better not download entire file to memory and just stream it directly into file
16 replies
CC#
Created by Pedro Gil Mora on 10/7/2024 in #help
Dictionary vs switch in source generated code
Iirc there was a dialog here that dict wins a switch in speed above some ~80 branches
52 replies
CC#
Created by Pedro Gil Mora on 10/7/2024 in #help
Dictionary vs switch in source generated code
Was this a frozen dict or a normal one?
52 replies
CC#
Created by Jiry_XD on 9/30/2024 in #help
✅ What's new in .NET 8 regarding making a WASM project?
Isn't it pre .net8 template?
46 replies
CC#
Created by Jiry_XD on 9/30/2024 in #help
✅ What's new in .NET 8 regarding making a WASM project?
I would suggest reading this
46 replies
CC#
Created by Jiry_XD on 9/30/2024 in #help
✅ What's new in .NET 8 regarding making a WASM project?
And two former can have prerender
46 replies
CC#
Created by Jiry_XD on 9/30/2024 in #help
✅ What's new in .NET 8 regarding making a WASM project?
There is interactive wasm, interactive server (aka Blazor server) and static ssr
46 replies
CC#
Created by Jiry_XD on 9/30/2024 in #help
✅ What's new in .NET 8 regarding making a WASM project?
The latter can have different render modes
46 replies
CC#
Created by Jiry_XD on 9/30/2024 in #help
✅ What's new in .NET 8 regarding making a WASM project?
Now there is either Blazor wasm standalone or just Blazor web app
46 replies
CC#
Created by Kaygee on 9/19/2024 in #help
Convert a Binary string to a file
Also prefer async versions of those methods
5 replies
CC#
Created by hunterlan on 8/27/2024 in #help
Blazor Static SSR - redirect after form submission
@hunterlan
8 replies
CC#
Created by hunterlan on 8/27/2024 in #help
Blazor Static SSR - redirect after form submission
Or, to write less code, change your catch-all to
catch (Exception ex) when (ex is not NavigationException)
{
Logger.LogError(ex, "Login failure");
ErrorMessage = "Something went wrong";
}
catch (Exception ex) when (ex is not NavigationException)
{
Logger.LogError(ex, "Login failure");
ErrorMessage = "Something went wrong";
}
8 replies
CC#
Created by hunterlan on 8/27/2024 in #help
Blazor Static SSR - redirect after form submission
Navigation exception is not a real exception and its annoying
8 replies
CC#
Created by hunterlan on 8/27/2024 in #help
Blazor Static SSR - redirect after form submission
I've faced this thing, my solution was to add
catch (NavigationException)
{
throw;
}
catch (NavigationException)
{
throw;
}
before catch-all branch
8 replies
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
I would stick to
Regex.Replace(url, "[^A-Z0-9]", match => Replacements.GetValueOrDefault(match.Value) ?? match.Value)
Regex.Replace(url, "[^A-Z0-9]", match => Replacements.GetValueOrDefault(match.Value) ?? match.Value)
22 replies
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
It will allocate a new string for every replaced char
22 replies
CC#
Created by Sticky on 6/28/2024 in #help
Tidying and making a repeat column faster
Performance-wise I would not recommend this
22 replies
CC#
Created by Alex on 6/25/2024 in #help
✅ How to get Options from DI
Btw $options
14 replies