I like the title of the video. It highlights precisely why you should not bother too much with remembering exact implementations and instead focus on truly understanding and grasping concepts. Concepts remain the same, but implementations change often. Thanks for another great tutorial, Dan!
@Codewrinkles
Жыл бұрын
I'm glad you enjoyed it.
@Forshen
Жыл бұрын
Hi, i don't get the concept of the Request and the handler of it. Cause Mediatr has the Send function, passing a object, and 1 handler for handling that object. But why it is better compared to just calling a command/query directly?
@xelaksal6690
Жыл бұрын
Thanks for the video. This background music in my opinion fits most and don't interrupt the experience.
@Codewrinkles
Жыл бұрын
Thank you very much for watching and for the feedback.
@andersonhansen9542
Жыл бұрын
MediatR is very nice, but there is always the question "Should I use it or not in production?"
@Codewrinkles
Жыл бұрын
I'm not sure how much you follow we on Twitter or LinkedIn, but I'm certainly that kind of guy that thinks adding a library to your project means addign technical debt. Which might be good or bad, depending how you plan to deal with this technical debt. Coming back to MediatR, I'd say it depends. In some projects I've used it. In some projects not. Where I find the most value in this library are pipeline behaviors, so if I think that in a project I'll make heavy use of this feature, then I prefer to use MediatR than to write similar functionality.
@manilladrift
Жыл бұрын
@@Codewrinkles mind explaining why you think adding third party libraries to an enterprise project is adding technical debt?
@nove1398
Жыл бұрын
@@manilladrift one reason is you will have to maintain that package. I have the same opinion , if you can get by without depending on anything external i prefer that way, but this is more so a personal agreement than a general guideline.
@Codewrinkles
Жыл бұрын
There are a lot of reasons like intellectual property (customers want to have IP over the code of their apps), library lock-in, potential unpredictable costs, security vulnerabilities and so on
@kabal911
Жыл бұрын
@@nove1398 you also need to seriously weigh up that you might have just transferred that technical debt. A developer must now build it and maintain it. This build might not actually offer any business value. Very popular libraries are often battle tested by 100’s of thousands of developers. As with everything, it depends 👍🏻 However, if you are not the one paying for the development, then i do not agree that “personal preference” is a valid reason. Licensing costs/restrictions, etc - absolutely.
@user-kg7if8ed6k
Жыл бұрын
I've encountered an annoying problem when I created a project with dotnet 7 and used MediatR 12.0.1I configured MediatR in Program.cs as bellow :builder.Services.AddMediatR(cfg => cfg.RegisterServicesFromAssembly(typeof(Program).Assembly)); and use it in the controller as bellow : public async Task AddCustomer([FromBody] CustomerInfo command) { await _mediator.Send(new AddCustomerCommand(command)); return StatusCode(201); } Apart from that I implementing Handler as bellow : private readonly ICustomerRepository _customerRepository; public AddCustomerCommandHandler(ICustomerRepository customerRepository) => _customerRepository = customerRepository; public async Task Handle(AddCustomerCommand request, CancellationToken cancellationToken) { await _customerRepository.AddCustomerAsync(request.customer); return; } and Command as :public record AddCustomerCommand(CustomerInfo customer) : IRequest; but encountered :No service for type 'MediatR.IRequestHandler has been registered. I googled that error and tried several things to configured MediatR in Program.cs but the result was the same.Could you please help me ?
@thomaswoods1365
6 ай бұрын
I had the same experience. I CANNOT get MediatR 12 to work!
@ramfattah211
Жыл бұрын
Thanks. Amazing video. I have a video suggestion idea if it's alright: could you do video on inheritance and entity framework in regards creating models and registering them in DbContext class. Also how would we view different derived model in a blazor component and how would we return the derived model classes in the data access layer of the project? For example, do we need to do some sort of casting to view the derived class in a blazor server component?
@Codewrinkles
Жыл бұрын
Great suggestion. The topic of persistence strategy for inheritance trees is actually a very good one. I think the Blazor part would fit in a different video though. I'm considerin these ideas.Thanks for watching and commenting.
@ramfattah211
Жыл бұрын
@@Codewrinkles Thank you so much for considering this. Looking forward to learning more c# from you 😊
@codewkarim
Жыл бұрын
Imagine stopping the video at "Forget everything you know about MediatR". JK. Good video thanks!
@MrVarsium
Жыл бұрын
is this new version more performant then the "mediator" package? (its a bit aside of goal of this vid sorry)
@Codewrinkles
Жыл бұрын
I'll be honest with you and I'll say that I haven't run any benchmark against it so far. But that's a good idea and maybe something for a dedicated video. Thanks for watchin and for the comment.
@Codewrinkles
Жыл бұрын
Does it also support notifications and behaviors?
@kabal911
Жыл бұрын
MediatR’s performance overhead is negligible compared to things that you would do in handlers like I/O. (microseconds vs milliseconds) If performance is a real consideration (which is IMO vastly overstated), then it is unlikely that MediatR would be a real candidate for a tool anyway.
@longuinni
10 ай бұрын
I don't know why people need MediatR. I can do everything with DI and .net core features.
@user-uq5us4bp7p
Жыл бұрын
Can you remove music please
@Codewrinkles
Жыл бұрын
Thank you for the feedback. I will take this into consideration.
Пікірлер: 25