Customizing generated application

Various parts of the generated application by Radzen can be customized without breaking the app continuous regeneration. To do this you can use your favorite code editor, for example Visual Studio 2019 or Visual Studio Code.

Code generation ignore list

By default Radzen generates code for your Radzen application pages and data sources (Blazor components, pages, services, etc). If you want to tweak the code you can do so in one of two ways:

  1. By following the Radzen extensibility rules and writing your custom code in the provided extensibility hooks listed later in this article.
  2. By adding the file(s) you want to modify in Radzen’s code generation ignore list. This section shows how this is done.

The Code generation ignore list is advanced feature that should be used only if none of the provided extensibility hooks would work for you.

You can add a certain file, list of files or entire directories to Radzen’s code generation ignore list by going to the application settings (the three dots button in the top right corner). Then add a list of files or directories separeated with a new line in the Code generation ignore list textbox.

The ignore list follows the gitignore conventions.

Here is a quick FAQ about ignored files:

What happens to ignored files

Radzen will not longer output code to files that match the ignore list. For example if you ignore the server\Pages\Products.razor page and you make changes, those changes will persist. If you later modify that page from Radzen’s designer you will not see any code generated for those changes. The changes will be persisted in the metadata though.

Will Radzen preview my changes in design time

Radzen uses the metadata (stored in the meta directory) to generate the design time experience. This is why any custom modifications to the generated code will not be previewed.

Remove files from ignore list

Remove the ignore rule that matches those files from the application setting and run the application. Radzen will update the files that were in the ignore list.

Customizing the code

When you add Microsoft SQL Server and/or PostgreSQL data-source, Radzen will generate service for the Blazor application. Tables, views and stored procedures are represented by methods and you can customize every read, add, update, delete operation or stored procedure execution using C# partial classes and methods.

public partial class SampleService
{
    partial void OnOrdersRead(ref IQueryable<Models.Sample.Order> items)
    { 
    
    }

    partial void OnOrderDeleted(Models.Sample.Order item)
    { 
    
    }

    partial void OnOrderUpdated(Models.Sample.Order item)
    { 
    
    }

    partial void OnOrderCreated(Models.Sample.Order item)
    {

    }
}

We are here for you

Making our users happy is always a priority for us.