---
title: "M B A R K (@MbarkT3sto) | Hashnode"
description: ".NET Specialist. Read the latest articles by M B A R K on Hashnode."
url: "https://hashnode.com/@MbarkT3sto"
---

@MbarkT3sto

# M B A R K

@MbarkT3sto · Morocco · Joined October 2022

.NET Specialist

## Comments

[Please how to add/chance those headers colors as in the preview GIF ???](https://hashnode.com/posts/preview-dbml-code-from-vscode/662ed4b321e0c09ce48cdf73/comment/67974f6062a129958299e254)

Comment · Article · Jan 27, 2025 · [Preview DBML code from Vscode](https://hashnode.com/posts/preview-dbml-code-from-vscode/662ed4b321e0c09ce48cdf73)

[Take a look on this article https://mbarkt3sto.hashnode.dev/how-to-generate-a-jwt-in-aspnet-core-api-with-identity-and-ef-core#heading-step-3-create-the-token and also you can see the attached demo project with this article to understand, you can find it here https://github.com/MbarkT3STO/JWTExample/tree/master/JWTExample](https://hashnode.com/posts/a-comprehensive-example-implementing-jwt-authentication-in-aspnet-core-with-identity-and-ef-core/63bfbf4fc64b803e4fffcc75/comment/649267c8c167b41645fd2f7a#reply-649c30fa30c0ca9898ddbff6)

Reply · Article · Jun 28, 2023 · [A Comprehensive Example: Implementing JWT Authentication in ASP.NET Core with Identity and EF Core](https://hashnode.com/posts/a-comprehensive-example-implementing-jwt-authentication-in-aspnet-core-with-identity-and-ef-core/63bfbf4fc64b803e4fffcc75)

[To clarify the connection between MediatR and the pipeline behavior, let's dive deeper into the implementation. In the article, the pipeline behavior is implemented using the IPipelineBehavior interface provided by MediatR. The ValidationPipelineBehavior class is created as a custom pipeline behavior that intercepts the incoming requests and performs validation before passing them to the corresponding handlers. Here's a breakdown of the steps involved: The ValidationPipelineBehavior class is defined, implementing the IPipelineBehavior<TRequest, TResponse> interface. This interface allows customization of the behavior for specific types of requests and responses. The behavior class takes an IValidator<TRequest> as a dependency through the constructor. This allows the behavior to access the corresponding validator for each request type. The Handle method of the behavior class is implemented, which is invoked by MediatR for each incoming request. Within this method, the behavior performs the following steps: a. It calls the ValidateAsync method on the injected validator, passing the request object. b. The ValidateAsync method returns a ValidationResult object, which contains the result of the validation. c. If the validation fails (i.e., validationResult.IsValid is false), a ValidationException is thrown, providing the validation errors. d. If the validation succeeds, the behavior invokes the next() delegate, which continues the execution of the request through the pipeline. In the ConfigureServices method in the Startup.cs file, the behavior is registered with MediatR using the AddTransient method. By registering the ValidationPipelineBehavior as a transient service, MediatR is informed to apply this behavior to all requests and responses passing through the pipeline. In addition to all what written, I was noticing in the first of the article that you have to be familiar with CQRS using MediatR and Fluent Validation libraries, all I did in this article is combining between them. Thanks](https://hashnode.com/posts/aspnet-core-how-to-use-fluent-validation-with-cqrs-mediatr/648c87f737c660bb64800a64/comment/648f7be5bc7a800db423154e#reply-648ffa2c018fec138a9a98f8)

Reply · Article · Jun 19, 2023 · [ASP.NET Core: How to use Fluent Validation with CQRS (MediatR)?](https://hashnode.com/posts/aspnet-core-how-to-use-fluent-validation-with-cqrs-mediatr/648c87f737c660bb64800a64)

[You're welcome bro.](https://hashnode.com/posts/enabling-lazy-loading-in-ef-core/63d280f407b98ce39cd9d3b4/comment/63d3ee24e56ca315fdf80786#reply-63d3fd3bfacbb01d327bca13)

Reply · Article · Jan 27, 2023 · [Enabling Lazy Loading in EF Core](https://hashnode.com/posts/enabling-lazy-loading-in-ef-core/63d280f407b98ce39cd9d3b4)

[It can be found in: System.Reactive namespace, for that you need to install the Reactive package: System.Reactive.](https://hashnode.com/posts/the-unit-type-in-c--deleted/63caf8c2bc411fc66a88d577/comment/63cb512e0a811f9ef11c7f41#reply-63cb8edc587fc59d3cd74647)

Reply · Article · Jan 21, 2023 · [The Unit Type in C#](https://hashnode.com/posts/the-unit-type-in-c--deleted/63caf8c2bc411fc66a88d577)
