Looks like a good step forward. I've always wanted the try/catch syntax to be stream-lined. Maybe create a Base class (or decorator) that could handle process/handle most exceptions that would allow a lot of boilerplate exception handling to be moved to another area... idk. thank you for the video.
Hi Shawn Nice video good example! Video idea: I constantly see people overusing the dotnet mediator pattern, even for small monolithic apps. I'm not saying never use it, but only use it if you really need the decoupling. The most common excuse for using it is for unit testing, or "it's best practice." I call BS. Besides, it's a PITA to debug badly written mediator components (for well-structured projects with good naming conventions, it can be less of a pain, though). I'd like to hear your opinion on that.
Shawn , thanks for keeping us put to date is small practical and useful videos. I do not think any anyone has done a good treatment of object cloning, from the simple case to the shared reference case, so many ways to do it, reflection, code generation , Dehydrate - Hydrate, it could be a good series of videos
This is an interesting pattern. One thing I missed is the scope of the exception handler - is it intended to handle every exception in your whole project, or just incoming http requests? For example would you have to use the httpcontext inside TryHandleAsync to limit its behavior to, say, just paths that start with /api (exposed endpoints)?
Hy Shawn, always like your content, appreciated! As for suggestions: what would be a smart way to implement authorization in Blazor based on the ClientId the user is in combined with his/her role for that client. I guess Policy based authorization with AuthorizationHandler and PolicyHandler would be the one to use (check role) but how to combine specifying checking role and ClientId together? Ideally one would do [Authorize(Roles = "Administrator", ClientId = _clientId)], but the last parameter is not possible (is my fantasy).
I think using the hellangs problem details middleware is more useful for real world exception handling especially when we have to handle specific exceptions.
Depends on what you want to do. But, since I haven't worked with it, I can't comment on how it works. It looks more like a way to log exceptions than to actually deal with them. But I get your point.
@swildermuth How have you handled exceptions on REST API so far in a standard way (RFC 9457) then if you haven't used that? It's basically a thing which is missing in ASP NET Core REST APIs
Thank you for explaining this. So I am assuming we can register multiple exception handlers and if that is the case will they follow any particular execution order like we see for middleware?
Hopefully it will not throw another exception when you set response status code, I had this experience with old exception handler middleware, sometimes it throws exception when you set the response status code and it says that status is already set or response is already begun.
what advice you would giive to a seasonal dotnet developer like me ? or a beginner T_T my mind is sooo overwhelmed with a lot of informations need to understand
@@swildermuth As my grandmother said, "Beauty is only skin deep. UGLY goes straight through to the bone!" - We love you Shawn, you are beautiful to us. Thanks for all you do - and the crap you put up with while making the world a better place.
Can't wait to upgrade. I have a need for this right now. 👏 Thank you, sir!
Happy to help!
Much more cleaner than creating your own middleware and try/catch the MoveNext call.
Thank you so much for your teaching great and simple presentation God bless you
So nice of you
Thanks so much for this. I liked/subscribed and did all the things. You’re doing great work, man.
Much appreciated!
Great content Shawn, always joyful to see your content sir. Hope you will cover also new API Identity endpoint. Thanks and God bless :)
Already did: ruclips.net/video/owoy6DG0UG0/видео.htmlsi=VYkeJIFfLOy4IE_E
ah I see. thanks :-)
Looks like a good step forward. I've always wanted the try/catch syntax to be stream-lined.
Maybe create a Base class (or decorator) that could handle process/handle most exceptions that would allow a lot of boilerplate exception handling to be moved to another area... idk.
thank you for the video.
Did not know about this. Thank you Shawn.
yw
Hi Shawn Nice video good example!
Video idea: I constantly see people overusing the dotnet mediator pattern, even for small monolithic apps. I'm not saying never use it, but only use it if you really need the decoupling.
The most common excuse for using it is for unit testing, or "it's best practice." I call BS. Besides, it's a PITA to debug badly written mediator components (for well-structured projects with good naming conventions, it can be less of a pain, though).
I'd like to hear your opinion on that.
Shawn , thanks for keeping us put to date is small practical and useful videos. I do not think any anyone has done a good treatment of object cloning, from the simple case to the shared reference case, so many ways to do it, reflection, code generation , Dehydrate - Hydrate, it could be a good series of videos
Good idea.
This is an interesting pattern. One thing I missed is the scope of the exception handler - is it intended to handle every exception in your whole project, or just incoming http requests? For example would you have to use the httpcontext inside TryHandleAsync to limit its behavior to, say, just paths that start with /api (exposed endpoints)?
It handles unhandled exceptions. It's the last line of defense, not used to avoid exception handling in your endpoints.
Great content! Thanks!
My pleasure!
Thank you Shawn
Hy Shawn, always like your content, appreciated! As for suggestions: what would be a smart way to implement authorization in Blazor based on the ClientId the user is in combined with his/her role for that client. I guess Policy based authorization with AuthorizationHandler and PolicyHandler would be the one to use (check role) but how to combine specifying checking role and ClientId together? Ideally one would do [Authorize(Roles = "Administrator", ClientId = _clientId)], but the last parameter is not possible (is my fantasy).
Not sure how it works in Blazor, I use claims, but where you create the claims is based on how you're doing Authentication.
I think using the hellangs problem details middleware is more useful for real world exception handling especially when we have to handle specific exceptions.
Depends on what you want to do. But, since I haven't worked with it, I can't comment on how it works. It looks more like a way to log exceptions than to actually deal with them. But I get your point.
Yeah this. Returning ProblemDetails structure with status code based on exception subclass is the way to go.
@swildermuth How have you handled exceptions on REST API so far in a standard way (RFC 9457) then if you haven't used that? It's basically a thing which is missing in ASP NET Core REST APIs
Thank you for explaining this.
So I am assuming we can register multiple exception handlers and if that is the case will they follow any particular execution order like we see for middleware?
Didn't try, but I expect so.
.net aspire would be a good one from you shawn
Great video. Would love to see you deploy an aspire on a self-hosted environment, such as a raspberry pie and windows server 2016
Still getting my head around Aspire and it's use cases. When you say 'self-hosted' - do you mean called from the command-line?
Great video Shawn! =)
Glad you enjoyed it
this .http file is cool, I guess PostMan and Fidler do not think so but me as a developer... love it
Awesome!
awesome content
I appreciate it.
Thanks that's was really helpful.
I like it, thank you.
I'm glad you like it
Hopefully it will not throw another exception when you set response status code, I had this experience with old exception handler middleware, sometimes it throws exception when you set the response status code and it says that status is already set or response is already begun.
I hope so too
Any Repository related to this video? Thx
Thanks Mr Shawn for your help with youtub and plurilsigh, please do you have a private learning center where people can change idea and learn ?
I am considering creating a discord for fans. Subscribe and you'll find out when it goes live.
@@swildermuth ok sir thanks
what advice you would giive to a seasonal dotnet developer like me ? or a beginner T_T my mind is sooo overwhelmed with a lot of informations need to understand
You don't have to drink through the firehose. Focus on making code that accomplishes the task .
hi is there anyway i can use parameterized Mappers in dotnet core?
if so how do i register those mappers?
Maybe, can you explain what you mean? I think Mapster and AutoMapper support something like that, but I am not sure exactly what you mean?
how can i run two project of dontnet (asp mvc and api) in same time in vscode?
Best way is to just use two terminal windows and call "dotnet run" in each folder
@@swildermuth 👍
hey can you do a quick video of VSCode, .NET MAUI dev with the C# devkit, either you or the legendary Scott Hanselman....please
I don't have the Maui experience I'd need to do it. But I'll throw it on my list to see if I can do it.
@@swildermuth much appreciated and thank you, actually I think I need to pester @jamesmontemagno
Exception handler is throwing an exception. 😂 That is such a Microsoft thing to happen
Dude…. Put the camera down step away from the computer and go outside and get some physical activity in. Exceptions don’t mean shit if you are dead.
Wait, am I fat? I never noticed. This sort of post ends up shaming and not supporting people. It's more complex than that.
@@swildermuth As my grandmother said, "Beauty is only skin deep. UGLY goes straight through to the bone!" - We love you Shawn, you are beautiful to us. Thanks for all you do - and the crap you put up with while making the world a better place.
nice