Whoever given dislike, I would like to ask u people, have u guys even imagine how many people around the world got job by going through Kudvenkat sir's free video series in different techniques of .NET?? Think widely guys...dont simply make urself fool in front of every one.. This is such a very very good explanation. Keep it up sir..very good afford and we all liked it..salute u!
If you're using version after 3.1 after the endpoints middleware add app.Use(next => context => { throw new Exception("new error found"); }); it will display the error page for any other page that is not your main
Dude. What the f$%k. Shit is starting to click and I'm truly beginning to understand this whole middleware concept. I knew if I kept going things would start clearing up and I've seemed to learn new things in every video I've been watching. Thank you so much my dude! Keep up the good work!
Hi Venkat, We want to see your face and tell about you in separate video or VLog please... Please give thumbsUp (if any one willing about our "Teacher" like me).
What if we don't throw new exception in your code and any how ABC.html doesn't exist in this scenario....so how does this gets handled....I guess we should see 404 err
@@Csharp-video-tutorialsBlogspot Sir, I got the same doubt, but I am still confused that the does the Use file Server method not throw any exception bcoz it didn't find the file?
It would be logical for UseStaticFile middleware, as a middleware that serves static files, to throw an exception if it does not find a static file, rather than forwarding the request to the next middleware. The next middleware will certainly not serve that file.
Hi @Kudvenkat. I created a middleware in my application . For incoming request i willingly set the context's status code as 400 Bad request. Also i let the request to pass on to controller method. From API cotroller method i returned response as Accepted(); i:e (return Accepted();) I saw i still got the response in Postman as BadRequest with 400 as status code. According to me status code should be overridden with Accepted() 's status code.. but it didn't happen. Can you please help me in understanding that.
In C# you can create objects like this as well. List myList = new List() { "Sara", "Mike", "Tony" }; Now myList contains these names without using the Add method. That's why I Love C#
Hi Avantika! this is called Object Initializer Syntax in c#. Object initializers allow you to assign values to the fields or properties at the time of object creation. You can google for more details :)
Hi Sir. Where to throw Exception in As.NET Core 3.1 as we have UseEndpoints Method instead of Run method. I throw exception in UseEndpoints Method but it didn't work for me.
I think that's because the endpoint in the existing code was '/', so when you try to test it out with say '/test.html', it doesn't even see the exception because this is the wrong endpoint. what you can do is comment out the 'app.UseFileServer()', and test the stuff in the video that way, or simply use app.Run like in the video and test it out.
4 года назад
Kudvenkat is a great teacher..........I don't see any elegance in asp.net core........easy to make mistakes and forget things.