Visual Studio Scaffold New Item, for Blazor?

1 Answer 168 Views
General Discussions Grid VS Code Extension
Jonathan
Top achievements
Rank 1
Iron
Jonathan asked on 24 Jul 2024, 02:59 PM

Visual Studio has this Feature.

  1. Create Blazor Web Project
  2. Right click Project, select "Add" and "New Scaffolded Item..."
  3. You get a list of templates, I believe from here GitHub - dotnet/Scaffolding: Code generators to speed up development.

Does Telerik plan on adding any templates for New Scaffolded Item?

I have imagined I chose "EF Core API to Telerik Grid" as a template.  I select the DbContext and Entity from a wizard and press Go. Then it will scaffold for me, with wonderfully crafted models and dependency injection repository pattern, service pattern, controller patterns:

  1. Server Side
    1. DTO Model or database model
    2. Mapping from Entity to DTO
    3. Repository Pattern: Entity Repository with CRUD
    4. Service to Call Repository
    5. Controller to call Service
  2. Client Side
    1. View Model
    2. Mapping from DTO to View Model
    3. HTTP Service to call Controller 
  3. Razor Page with Telerik Grid
    1. Using View Model to build default columns
    2. Default Telerik Editor features
      1. Or a choice between in-line and modal editors
    3. Razor.cs calls HTTP Service
    4. Razor.cs has all CRUD functions

Why? Because I've done this cookie-cutter, boilerplate type of thing so many times I think it should become a candidate for integration into Visual Studio as "Add New Scaffolded Item".

Does Telerik plan to work on this?  Perhaps I could help contribute

1 Answer, 1 is accepted

Sort by
0
Svetoslav Dimitrov
Telerik team
answered on 29 Jul 2024, 08:10 AM

Hello Jonathan,

We already provide page scaffolding with Telerik UI for Blazor components. In the case of the Grid, you can specify the model and its configuration parameters through an interface. The Telerik UI for Blazor components are data agnostic, meaning they depend on an already-created data layer. 

Regards,
Svetoslav Dimitrov
Progress Telerik

Do you have a stake in the designеr-developer collaboration process? If so, take our survey to share your perspective and become part of this global research. You’ll be among the first to know once the results are out.
-> Start The State of Designer-Developer Collaboration Survey 2024

Jonathan
Top achievements
Rank 1
Iron
commented on 29 Jul 2024, 12:33 PM | edited

Svetoslav,

Thank you for answering, but one of the most important parts of this feature would be the ability for me to customize the scaffold templates.

Does the Telerik feature allow for end users to customize scaffolding templates (T4)?

Do I need to start the Solution as a Telerik Solution to use the scaffolding? I have the Telerik UI for Blazor Extension installed but I do not see the option as is stated here:


Quickly Adding Components with Code Scaffolders - Visual Studio Integration - Telerik UI for Blazor

Adding New Component Pages

  1. Right-click the name of the solution.
  2. From the popup menu, select the Telerik UI for Blazor Project Item.
  3. From the UI form, select the desired component and set the available parameters.
  4. The scaffolded page will be added to the Pages folder.


 

Dimo
Telerik team
commented on 31 Jul 2024, 02:31 PM

@Jonathan

>> Does the Telerik feature allow for end users to customize scaffolding templates (T4)?

The Telerik scaffolder allows developers to configure component features. See screenshot step_3.png.

>> Do I need to start the Solution as a Telerik Solution to use the scaffolding?

No, you just need Telerik UI for Blazor to be added to the app. I think the instructions may be misleading. You need to right-click a project, not a solution. See screenshot step_2_and_4.png. I will confirm with my colleagues and fix the documentation.

Tags
General Discussions Grid VS Code Extension
Asked by
Jonathan
Top achievements
Rank 1
Iron
Answers by
Svetoslav Dimitrov
Telerik team
Share this question
or