5 Amazing Use Cases for MediatR Pipelines - Cross-Cutting Concerns

preview_player
Показать описание

Cross-cutting concerns are software aspects that affect the entire application. These are your common application-level functionalities that span several layers and tiers. Cross-cutting concerns should be centralized in one location. This prevents code duplication and tight coupling between components. In this video, I'll show you how to solve cross-cutting concerns using MediatR pipelines. We'll solve error handling, logging, caching, transaction management, and validation.

Balancing Cross-Cutting Concerns in Clean Architecture

Join my weekly .NET newsletter:

Read my Blog here:

Chapters
0:00 What is a MediatR Pipeline Behavior?
1:20 1 - Logging
2:48 2 - Exception handling
4:26 3 - Validation
6:16 4 - Caching
8:28 5 - Transactions
11:29 Pipeline execution order
Рекомендации по теме
Комментарии
Автор

This is very great stuff. Thank you!!!

schoderfactory
Автор

You make coding life easier every day. ❤
Could you please make videos on ConfigureAwait(false) and a full video on Transaction Pipeline behaviour?

SalmanShafiq-yq
Автор

Thanks Milan for (another) great video!
I just wonder if a command class implementing the interface:
public interface : ICommand<TResponse>, ITransactionalCommand { }
will not cause a compilation error when used like this: var result = Mediator.Send(command)
because it tries to assign "void" to a variable.
It requires an explicit cast of the command instance to: ICommand<TResponse> which is not very convenient.
Thanks again!

bennybloch
Автор

Funny.. I was just playing around pipeline behaviors and implemented similar approach for transaction handling.
This video would saved a lot of time to get basics right 😂 But i usually do things a hard way 😅

jarnohonkanen
Автор

It's great!! Could you tell us where we get the Result type to implement in the Behavior ?

miguelamorese
Автор

The pipeline for setting up transactions is really a gamechanger for me. The implemenation is so easy. Still we do save data in een external CMS. What makes it harder to do transactions overall.

julien
Автор

Would be great if you could add links to some git repos in the description. Easier to follow through with the videos.

tasin
Автор

How would you handle TransactionalPipelineBehavior and IUnitOfWork with multiple DbContexts?

Kylefuller
Автор

In caching pipeline behaviour, when hit cache method GetAsync() it generates an error of deserialization from string because in Result class there is no default constructor and there are multiple constructor but which constructor i want to use for deserialization is not declared.
should I change Result class by adding default constructor? but in result i did not see any default constructor. what to do?

SalmanShafiq-yq
Автор

For some reason, the pipeline does not get hit when I specify the generic constraint "where TResponse : Result"
Even though when I debug wihtout that constraint, it shows that the TResponse is of that type. 😵 I'm resorting to using reflection on the type after the call gets hit and bypass when it's not of that type. So weird.

Laggie
Автор

Could you please make a video about bulk images upload without memory leakage and save image path

mpyoonuskunhava
Автор

IUnitOfWork ->Task<IDbTransaction> BeginTransactionAsync(); Implementation logic?

sunzhang-dv
Автор

No words on IRequestPreProcessor/IRequestPostProcessor, are they kinda useless nowadays, and we should always use just IPipelineBehavior?

arteqppp