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

Blazory

Bart Van Hoey

|
1,950 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

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

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                                          
 yAuthorizeAttribute                  | AuthorizeAttribute                                               
 yCascadingPara                       | Inserts a CascadingParameter attribute                           
 yCascadingParaAuthState              | Cascading parameter AuthenticationState                          
 yCascadingParaProp                   | Inserts a property with 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                                            
 yIf                                  | If statement                                                     
 yIfInline                            | If inline statement                                              
 yIfNotNull                           | If not null statement                                            
 yIfNotNullInline statement           | If not null inline statement                                     
 yIfNull                              | If null statement                                                
 yIfNullInline statement              | If null inline statement                                         
 yInheritsComponentBase               | Inherits ComponentBase                                           
 yInjectAttribute                     | Inserts InjectAttribute                                          
 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                                    
 yMethodAsync                         | async method stub without arguments                              
 yMethodAsyncReturn                   | async task method stub without arguments                         
 yMethodAsyncReturnWithArgs           | async task method stub with arguments                            
 yMethodAsyncWithArgs                 | async method stub with arguments                                 
 yMethodReturn                        | method stub without arguments                                    
 yMethodReturnWithArgs                | method stub with arguments                                       
 yMethodVoid                          | void method stub without arguments                               
 yMethodVoidWithArgs                  | void method stub with arguments                                  
 yNavigateToId                        | NavigationManager.NavigateTo page\\Id                            
 yNavigateToPage                      | NavigationManager.NavigateTo page                                
 yOnAfterRender                       | OnAfterRender method stub                                        
 yOnAfterRenderAsync                  | OnAfterRenderAsync method stub                                   
 yOnInitialized                       | OnInitialized method stub                                        
 yOnInitializedAsync                  | OnInitializedAsync method stub                                   
 yOnParametersSet                     | OnParameterSet method stub                                       
 yOnParametersSetAsync                | OnParameterSetAsync method stub                                  
 yPaginationState                     | Inserts a PaginationState field                                  
 yParaAttribute                       | Inserts a Parameter attribute                                    
 yParaCaptureUnmatchedValues          | Parameter CaptureUnmatchedValues attribute                       
 yParaIdProp                          | Inserts an Id property with Parameter attribute                  
 yParaProp                            | Inserts a property with Parameter attribute                      
 yRangeAttribute                      | Range attribute                                                  
 yReadIdFromJsonAsync                 | HttpClient.ReadFromJsonAsync call                                
 yReadOnlyHttpClientField             | Readonly HttpClient field                                        
 yRequiredAttribute                   | RequiredAttribute                                                
 yRouteAttribute                      | RouteAttribute                                                   
 ySetParametersAsync                  | SetParametersAsync method stub                                   
 yShouldRender                        | ShouldRender method stub                                         
 yStateHasChanged                     | Inserts StateHasChanged() method                                 
 yStringLengthAttribute               | StringLength attribute                                           

Razor files (source code)

 Prefix                            | Description                                                 
 --------------------------------- | ------------------------------------------------------------ 
 inputTextAreaAndLabel             | Inserts an InputTextArea component + label                  
 yAuthorizeAttribute               | @attribute [Authorize]                                      
 yBind                             | Bind attribute                                              
 yBindFormat                       | @bind:format="MyFormat"                                     
 yBindOnInputEvent                 | @bind:event="oninput"                                       
 yBindOnProperty                   | @bind="MyProperty"                                          
 yBindValue                        | @bind-Value="MyProperty"                                    
 yCascadingAuthenticationState     | CascadingAuthenticationState stub                           
 yCascadingValue                   | Inserts a CascadingValue attribute                          
 yCode                             | @code block                                                 
 yColumnOptions                    | ColumnOptions                                               
 yComponent                        | Complete component                                          
 yComponentChildContent            | Complete component with ChildContent RenderFragment         
 yComponentDisposable              | Complete component inherits IDisposable                     
 yDataAnnotationsValidator         | DataAnnotationsValidator                                    
 yEditForm                         | Inserts EditForm component                                  
 yFormControlClass                 | Inserts a form-control class attribute                      
 yImplementsIDisposable            | @implements IDisposable                                     
 yInheritsBaseComponent            | @inherits C# code-behind base class                         
 yInheritsLayoutComponentBase      | Complete Layout component inherits LayoutComponentBase      
 yInheritsOwningComponentBase      | @inherits OwningComponentBase<ApplicationDbContext>         
 yInjectHttpClient                 | @inject HttpClient directive                                
 yInjectIAccessTokenProvider       | @inject IAccessTokenProvider directive in Blazor Server app 
 yInjectIConfiguration             | @inject IConfiguration directive in Blazor Server app       
 yInjectIJSRuntime                 | @inject IJSRuntime directive                                
 yInjectIMapper                    | @inject IMapper directive                                   
 yInjectNavigationManager          | @inject NavigationManager directive                         
 yInjectProtectedLocalStorage      | @inject ProtectedLocalStorage directive in Blazor Server app
 yInjectService                    | @inject MyService MyService                                 
 yInjectSignOutSessionStateManager | @inject SignOutSessionStateManager directive                
 yInputCheckbox                    | Inserts an InputCheckbox component                          
 yInputCheckBoxAndLabel            | Inserts an InputCheckBox component + label                  
 yInputDate                        | InputDate component                                         
 yInputDateAndLabel                | Inserts an InputDate component + label                      
 yInputFileComponent               | Inserts an InputFile component                              
 yInputNumber                      | Inserts an InputNumber component                            
 yInputNumberAndLabel              | Inserts an InputNumber component + label                    
 yInputRadio                       | Inserts a InputRadio component                              
 yInputRadioGroup                  | Inserts a RadioGroup component                              
 yInputSelect                      | Inserts an InputSelect component                            
 yInputSelectAndLabel              | Inserts an InputSelect component + label                    
 yInputSelectForEach               | Inserts an InputSelect (foreach) component                  
 yInputSelectForEachAndLabel       | Inserts InputSelect (foreach) component + label             
 yInputText                        | Inserts an InputText component                              
 yInputTextAndLabel                | Inserts an InputText component + label                      
 yInputTextArea                    | Inserts an InputTextArea component                          
 yLayout                           | @layout MyLayout                                            
 yNavLink                          | NavLink                                                     
 yNavLinkMatch                     | NavLink with MatchAttribute                                 
 yOnValidSubmit                    | OnValidSubmit                                               
 yPage                             | @page directive                                             
 yPageParam                        | @page directive with Parameter                              
 yPaginator                        | PropertyColumn                                              
 yPreventDefault                   | PreventDefault attribute                                    
 yPropertyColumn                   | PropertyColumn                                              
 yQuickGrid                        | Inserts a QuickGrid                                         
 yRef                              | @ref="MyProperty"                                           
 yTemplateColumn                   | TemplateColumn                                              
 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
© 2023 Microsoft