Skip to content
| Marketplace
Sign in
Visual Studio>Tools>Best Practices generator
Best Practices generator

Best Practices generator

Preview

Elias Silva

|
66 installs
| (0) | Free
Generate clean architecture structure with Best.Practices framework
Download

Best Pratices Generator

A Visual Studio extension that generates the code from clean architecture approach based on an entity class and its properties.

What does it do?

This extension generates code for the solution and classes based on Best Practices framework for all Domain-Driven Design (DDD) layers and Clean Architecture layers. Using the Clean Architecture approach can be time-consuming as it involves many files, including classes, interfaces, and SQL scripts.

This extension simplifies the process by creating all the necessary files within the solution, saving you valuable time.

Types of files that this extension can do for you:

Solution:

  • A solution based on a template with all layers using clean architecture, DDD, and unit tests.

You can generate the necessary files for all layers for each entity(model) you want.

From Domain Layer:

  • Interface for the repository
  • Implementation class for the repository
  • Interface for the command provider

From Application Layer:

  • Dto record for create use case input
  • Dto record for update use case input
  • Dto record for use case output
  • Dto record for get by filter paginated use case output
  • Validation class for the dto create use case input
  • Validation class for the dto update use case input
  • Create Use Case class for the entity
    • Preventing register duplication if you need
  • Update Use Case class for the entity
    • Preventing register duplication if you need
    • Validate if the entity exists on the repository
  • Delete Use Case class for the entity
    • Validate if the entity exists on the repository
  • GetById Use case class
    • Validate if the entity exists on the repository
  • GetPaginated use case
  • Interface for query provider (used in GetById UseCase)
  • Interface for list item query provider (used in GetPaginated Use Case)
  • Error messages constants creation
  • Set Dependencies mappings for use cases
  • Set Dependencies mappings for validators

From Infrastructure Layer:

  • Dapper command class for the entity
  • Dapper command provider class for the entity
  • Dapper query provider class that implements command provider
  • Dapper query provider class that implements list item query provider
  • Dapper Table definition class for the entity
  • Set Dependencies mappings for command providers
  • Set Dependencies mappings for query providers
  • Migration SQL Script to create the table that represents the entity

From Unit Tests Layer:

  • Builder class for the create use case input dto
  • Builder class for the update use case input dto
  • Builder class for the use case output dto
  • Builder class for the list use case output dto
  • Builder class for the entity
  • Unit tests class for the entity
    • Test for each method
  • Unit tests class for create use case input dto validation
  • Unit tests class for update use case input dto validation
  • Unit tests class for create use case
  • Unit tests class for update use case
  • Unit tests class for delete use case
  • Unit tests class for get by id use case

From Presentation Layer:

  • Controller for entity operations:
    • Post endpoint
    • Put endpoint
    • Delete endpoint
    • GetById endpoint
    • GetPaginated by filter endpoint

Additionals:

  • Postman collection for the created endpoints that refer to:
    • Create Use Case
    • Update Use Case
    • Delete Use Case
    • GetById Use case
    • GetPaginated use case

Using the extension

Create a new project and select the Best.Practices solution template

2_-_SolutionTemplate__1.jpg

A solution will be created with a suggested structure

3_-_SolutionStructure.jpg

After creating an entity class, inherited from BaseEntity Right-click on the entity file in Solution Explorer or the Entity class editor

4_-_RightClickMenu.jpg

A tool window with a few options will appear. Select the options according to your needs and click on the 'Generate' button

5_-_ToolWindowOptio_ns.jpg

The files, including classes and interfaces, migration files, and Postman collection file will be created. You can see it on the output window

6_-_GeneratedFiles.jpg 7_-_PostmanCollection.jpg

With a few adjustments, you will be able to run the API

8_-_RunningApi.jpg

License

Apache 2.0

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft