Keep ASP.NET Core controllers clean using the power of base controllers

preview_player
Показать описание
I somehow have an obsession for clean controllers in #aspnetcore . That's one of the reason I am a strong advocate of MediatR and using granular handlers for each application action. Even so, we still end up having a lot of boilerplate code in our controllers, like private fields for IMediator, IMapper, ILogger and so on. In this video, we showcase a very powerful way to keep controllers clean using base controllers properly.
#dotnetcore

Table of contents:
1. Intro 00:00
2. App overview: 00:50
3. Problem statement: 03:32
4. A first unsuccessful try: 05:53
5. Moving non-generic services to base controller: 10:15
6. Moving generic services to base controller: 14:34
Рекомендации по теме
Комментарии
Автор

Just now at the moment, I was having the idea and I had the Constructor issue and I gave up then I saw your video and it was exactly what I really wanted. I never experienced this feeling but I'm so glad it did happen and now I'm happy my controller will be so clean.

Thank you so much for giving us exactly what every developer may face.

Keep going on bro.

mxd
Автор

Great Video. Exactly what I am looking for since I'm starting a new greenfield project with unknown developers

larman
Автор

This is a very good approach. Thank you.

FreaksSpeaks
Автор

Do you have video about generics and delegate?

MrBodyPower
Автор

thanks, can you make video about open tracing for .net

saefulrahman
Автор

For some reason the HttpContext is null when I do this. and Im using Controller(with views) instead of ControllerBase

Axelius
Автор

Thank you for the great video. What about unit tests, how to inject dependencies?

easyalgo
Автор

Hi man, i wanna ask you, i have an api that is secured with jwt and i want to implement password recovering, so, my question is,
how can i "destroy" or ban the jwt that were already emitted?

SparXisRCD
Автор

Hi
How can i Use this one in base controller for ConnectionString
My code is this in home controller

private readonly string _connectionString;

public ValuesController( IConfiguration configuration)
{
_connectionString =

}

manivad
visit shbcf.ru