DEV Community

RzR
RzR

Posted on

MediatRItemExtension - Visual Studio(2019,2022) extension made by developer for developers

This Visual Studio extension is designed to streamline the development process when working with the MediatR and FluentValidation NuGet packages.

FluentValidation is a .NET library for building strongly typed, expressive and reusable validation rules for objects, particularly model classes.

MediatR is a lightweight, in-process messaging library for .NET that implements the Mediator design pattern. It decouples the communication between objects, enabling a clean, maintainable, and scalable architecture by reducing direct dependencies between components.

This extension automates the creation of essential classes, such as Request (Command/Query object), Handler, and Validator, ensuring consistency and reducing manual effort. By eliminating the repetitive task of setting up these boilerplate components, the extension enhances productivity, allowing developers to allocate more time to higher-priority tasks from the backlog or active sprint.

From the box, are available functionalities are:

  • Save all classes in one file;
  • Create a file for each class;
  • Add import references (for MediatR and FluentValidation);
  • Select how the request will be executed Sync or Async;
  • Select which type of operation you want to create;
  • Specify the name of the folder/file;
  • Use one name for the folder/file where information will be stored;
  • Select an option if you want to add IStringLocalizer(Microsoft.Extensions.Localization) to Validator or/and to the Handler;
  • Specify any base class that will be added to the operation class (Query, Command, Notification);
  • Declare the operation inheritance class;
  • Declare the handler inheritance class.

You can install extensions from the VS marketplace (https://marketplace.visualstudio.com/publishers/RzR).

After installing the VS extension MediatRItemExtension.V2K19 or MediatRItemExtension.V2K22 (depending on which Visual Studio version you have installed).

Trigger/activate extension can be thought of as a shortcut or from the project/folder context menu:

Select a project or a folder from the solution:

-> SHIFT + INSERT + M;

-> Right click and select MediatR Items Creation.
Enter fullscreen mode Exit fullscreen mode

How the interaction window is shown

Preview

Repository:

GitHub logo I-RzR-I / MediatRItemExtension

This is a relatively simple VS extension that allows you to create necessary classes when u use `MediatR` with `FluentValidation` nuget packages. Also, allows to save time and redirect it to more important tasks that are on the board or in the queue.

Name Details
MediatRItemExtensionV2K19 Extension for Visual Studio 2019
MediatRItemExtensionV2K22 Extension for Visual Studio 2022

This is a relatively simple VS extension that allows you to create necessary classes when u use MediatR with FluentValidation nuget packages. Also, allows to save time and redirect it to more important tasks that are on the board or in the queue.

From the box are available functionalities as:

  • Save all classes in one file;
  • Create a file for each class;
  • Add import references (for MediatR and FluentValidation);
  • Select how the request will be executed Sync or Async;
  • Select which type of operation you want to create;
  • Specify the name of the folder/file;
  • Use one name for the folder/file where will be stored information;
  • Select option if you want to add IStringLocalizer to Validator or/and to the Handler;
  • Specify any base class which will be added to the operation class (Query

Top comments (0)