My tech radar leaning towards .NET related technologies but not exclusive to .NET
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@* Unfortunately this has to be named BlazorForm, not Form, because we can't differentiate based on casing *@ | |
<form onsubmit=@HandleSubmit> | |
@ChildContent(_context) | |
</form> | |
@functions { | |
private FormContext _context = new FormContext(); | |
[Parameter] protected RenderFragment<FormContext> ChildContent { get; set; } | |
[Parameter] protected Action<FormContext> OnSubmit { get; set; } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Ensure you always use global App namespace for EVERYTHING. | |
// This means that at runtime, it doesnt need to search inside namespaces and is 4-8x faster. | |
namespace App | |
{ | |
// Always use static classes, DI is bad practice and makes everything slow. | |
// If you MUST use DI, then ensure you use the container everywhere as a service locator so that it's faster. | |
public static class God | |
{ | |
[DebuggerHidden] // Hide, we dont want developers finding this and then trying to optimize it further, only chuck norris could do that. |