Skip to content
| Marketplace
Sign in
Visual Studio Code>Snippets>BlazoryNew to Visual Studio Code? Get it now.

Blazory

Bart Van Hoey

|
1,331 installs
| (1) | Free
Snippets that start with an y for Razor and C# code-behind files
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

Code Snippets that start with an y to speed up your Blazor development process

Blazory in Action!

Do you see room for improvement or do you have a snippet in mind you want to have included? Feel free to create an issue, I will see what I can do!

C# code-behind files (source code)

 Prefix                               | Description                                                      
 ------------------------------------ | ----------------------------------------------------------------- 
 yAddHttpClientWithHttpMessageHandler | Add HttpClient with HttpMessageHandler                           
 yApiControllerAttribute              | ApiController attribute                                          
 yCascadingParaAuthState              | Cascading parameter AuthenticationState                          
 yAuthorizeAttribute                  | AuthorizeAttribute                                               
 yCascadingPara                       | CascadingParameter attribute                                     
 yCompareAttribute                    | Compare attribute                                                
 yEventCallback                       | EventCallback parameter                                          
 yEventCallbackExtended               | EventCallbackExtended parameter                                  
 yEventCallbackOnParameterChanged     | EventCallbackOnParameterChanged                                  
 yEventHandler                        | EventHandler method stub                                         
 yEventHandlerAsync                   | EventHandlerAsync method stub                                    
 yGps                                 | { get, private set }                                             
 yGs                                  | { get, set }                                                     
 yHandleFileChosenAsync               | Inserts the HandleFileChosenAsync method for an InputFile element
 yHttpClientDeleteAsync               | HttpClient.DeleteAsync call                                      
 yHttpClientGetAsync                  | HttpClient.GetAsync call                                         
 yHttpClientGetFromByIdJsonAsync      | HttpClient.GetFromByIdJsonAsync call                             
 yHttpClientGetFromJsonAsync          | HttpClient.GetFromJsonAsync call                                 
 yHttpClientPostAsJsonAsync           | HttpClient.PostAsJsonAsync call                                  
 yHttpClientPostAsync                 | HttpClient.PostAsync call                                        
 yHttpClientPutAsJsonAsync            | HttpClient.PutAsJsonAsync call                                   
 yIEnumerable                         | IEnumerable statement                                            
 yIfInline                            | If inline statement                                              
 yIfNotNullInline statement           | If not null inline statement                                     
 yIfNotNull                           | If not null statement                                            
 yIfNullInline statement              | If null inline statement                                         
 yIfNull                              | If null statement                                                
 yIf                                  | If statement                                                     
 yInheritsComponentBase               | Inherits ComponentBase                                           
 yInjectHttpClient                    | Inject HttpClient property                                       
 yInjectIJSRuntime                    | Inject IJSRuntime property                                       
 yInjectIMapper                       | Inject IMapper property                                          
 yInjectNavigationManager             | Inject NavigationManager property                                
 yInjectService                       | Inject MyService MyService                                       
 yInjectSignOutSessionStateManager    | Inject SignOutSessionStateManager property                       
 yInvokeAsyncEventCallback            | Invoke async Eventcallback                                       
 yIsNotNull                           | Is not null                                                      
 yIsNull                              | Is equal to null                                                 
 yJSRuntimeInvokeAsync                | JSRuntimeInvokeAsync call                                        
 yJSRuntimeInvokeVoidAsync            | JSRuntimeInvokeVoidAsync call                                    
 yMethodAsyncWithArgs                 | async method stub with arguments                                 
 yMethodAsyncReturnWithArgs           | async task method stub with arguments                            
 yMethodReturnWithArgs                | method stub with arguments                                       
 yMethodVoidWithArgs                  | void method stub with arguments                                  
 yMethodAsync                         | async method stub without arguments                              
 yMethodAsyncReturn                   | async task method stub without arguments                         
 yMethodReturn                        | method stub without arguments                                    
 yMethodVoid                          | void method stub without arguments                               
 yNavigateTo                          | NavigationManager.NavigateTo page                                
 yNavigateToId                        | NavigationManager.NavigateTo page\\Id                            
 yOnAfterRender                       | OnAfterRender method stub                                        
 yOnAfterRenderAsync                  | OnAfterRenderAsync method stub                                   
 yOnInitialized                       | OnInitialized method stub                                        
 yOnInitializedAsync                  | OnInitializedAsync method stub                                   
 yOnParametersSet                     | OnParameterSet method stub                                       
 yOnParametersSetAsync                | OnParameterSetAsync method stub                                  
 yPara                                | Parameter attribute                                              
 yParaCaptureUnmatchedValues          | Parameter CaptureUnmatchedValues attribute                       
 yReadIdFromJsonAsync                 | HttpClient.ReadFromJsonAsync call                                
 yReadOnlyHttpClientField             | Readonly HttpClient field                                        
 yRequiredAttribute                   | RequiredAttribute                                                
 yRouteAttribute                      | RouteAttribute                                                   
 ySetParametersAsync                  | SetParametersAsync method stub                                   
 yShouldRender                        | ShouldRender method stub                                         

Razor files (source code)

 Prefix                            | Description                                                 
 --------------------------------- | ------------------------------------------------------------ 
 yAuthorizeAttribute               | @attribute [Authorize]                                      
 yBind                             | Bind attribute                                              
 yBindFormat                       | @bind:format="MyFormat"                                     
 yBindOnInputEvent                 | @bind:event="oninput"                                       
 yBindOnProperty                   | @bind="MyProperty"                                          
 yBindValue                        | @bind-Value="MyProperty"                                    
 yCascadingAuthenticationState     | CascadingAuthenticationState stub                           
 yCode                             | @code block                                                 
 yComponent                        | Complete component                                          
 yComponentChildContent            | Complete component with ChildContent RenderFragment         
 yDataAnnotationsValidator         | DataAnnotationsValidator                                    
 yComponentDisposable              | Complete component inherits IDisposable                     
 yEditForm                         | Inserts EditForm component                                  
 yPreventDefault                   | PreventDefault attribute                                    
 yFormCheckInputCheckBox           | Inserts form-group class InputCheckBox component            
 yFormControlClass                 | Inserts a form-control class attribute                      
 yFormGroupInputDate               | Inserts form-group class InputDate component                
 yFormGroupInputNumber             | Inserts form-group class InputNumber component              
 yFormGroupInputSelect             | Inserts form-group class InputSelect component              
 yFormGroupInputSelectForEach      | Inserts form-group class InputSelect ForEach                
 yFormGroupInputText               | Inserts form-group class InputText component                
 yFormGroupInputTextArea           | Inserts form-group class InputTextArea component            
 yImplementsIDisposable            | @implements IDisposable                                     
 yInheritsBaseComponent            | @inherits C# code-behind base class                         
 yInheritsLayoutComponentBase      | Complete Layout component inherits LayoutComponentBase      
 yInjectHttpClient                 | @inject HttpClient directive                                
 yInjectIJSRuntime                 | @inject IJSRuntime directive                                
 yInjectIMapper                    | @inject IMapper directive                                   
 yInjectService                    | @inject MyService MyService                                 
 yInjectNavigationManager          | @inject NavigationManager directive                         
 yInjectIAccessTokenProvider       | @inject IAccessTokenProvider directive in Blazor Server app 
 yInjectIConfiguration             | @inject IConfiguration directive in Blazor Server app       
 yInjectProtectedLocalStorage      | @inject ProtectedLocalStorage directive in Blazor Server app
 yInjectSignOutSessionStateManager | @inject SignOutSessionStateManager directive                
 yInputCheckbox                    | InputCheckbox component                                     
 yInputDate                        | InputDate component                                         
 yInputFileComponent               | InputFile component                                         
 yInputNumber                      | InputNumber component                                       
 yInputSelect                      | InputSelect component                                       
 yInputSelectForEach               | InputSelectForEach component                                
 yInputText                        | InputText component                                         
 yInputRadio                       | InputRadio component                                        
 yInputRadioGroup                  | Inserts a RadioGroup component                              
 yInputTextArea                    | InputTextArea component                                     
 yLayout                           | @layout MyLayout                                            
 yNavLink                          | NavLink                                                     
 yNavLinkMatch                     | NavLink with MatchAttribute                                 
 yOnValidSubmit                    | OnValidSubmit                                               
 yPage                             | @page directive                                             
 yPageParam                        | @page directive with Parameter                              
 yRef                              | @ref="MyProperty"                                           
 yTemplatedComponent               | Templated component                                         
 yTypeParam                        | @typeParam                                                  
 yUsing                            | @using MyNameSpace                                          
 yValidationMessageFor             | ValidationMessageFor                                        
 yValidationSummary                | ValidationSummary component                                 
 yVirtualizeComponent              | Inserts the Virtualize component                            
 yVoidDispose                      | Dispose method stub                                         
  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2022 Microsoft