Attribute Routing in ASP NET Core MVC

  Рет қаралды 147,638

kudvenkat

kudvenkat

Күн бұрын

Пікірлер: 53
@Andrew-ht7rf
@Andrew-ht7rf 4 жыл бұрын
Was just watching this video and the previous conventional routing video to get a handle on MVC routing. This video was so brilliant that I'm going to watch the entire series. Thanks mate from Australia.
@nayazpasha5963
@nayazpasha5963 4 жыл бұрын
You are just a legend sir.. I was searching for routing tutorials very badly.. You just nailed it!
@barney8545
@barney8545 4 жыл бұрын
The best .net core tutorial on KZbin
@fleurarkesteijn5122
@fleurarkesteijn5122 4 жыл бұрын
Love how thorough, clear and calm you explain everything!
@vinzer72frie
@vinzer72frie 5 жыл бұрын
I am glad to see you're staying fresh with the new tech including net core keep the good work
@TheWestDESIGN
@TheWestDESIGN 5 жыл бұрын
Binge watched the whole series. It's amazing, keep it up! :)
@1980goutam
@1980goutam 5 жыл бұрын
I really like the video. It help me lot to learn thank you very much to make such wonderful tutorial.
@InamiLanzhu
@InamiLanzhu 2 ай бұрын
Thanks again for another amazing lecture
@lastkingssaint4609
@lastkingssaint4609 2 жыл бұрын
Once again, excellent tutorials!
@DarkCloud7
@DarkCloud7 5 жыл бұрын
At 4:35 you can optionally also just change the attribute to: [Route("Home/Details/{id=1}")] and leave the rest identical, this also creates the default behaviour (using core 3.0 btw). I don't know if this method has any drawbacks.
@conaxlearn8566
@conaxlearn8566 4 жыл бұрын
Or public ViewResult Details(int id=1) {...}
@aszuts
@aszuts 2 жыл бұрын
Very nice and clear explanation of attribute routing! (Y)
@chillbro2275
@chillbro2275 5 жыл бұрын
Wow cool feature, and well explained and demonstrated!
@MicroftHunter
@MicroftHunter 5 жыл бұрын
12:09 I've tested this attribute routing but I've encountered errors with this Error: This localhost page can't be found "localhost:4259/home/index" Other links are fine: "localhost:4259/" "localhost:4259/home" "localhost:4259/home/details" "localhost:4259/home/details/1" Please answer me @kudvenkat
@deepakha9759
@deepakha9759 3 жыл бұрын
Crystal clear explanation!
@sylviur
@sylviur 4 жыл бұрын
Thank you for this wonderful presentations.
@MyGreenpotato
@MyGreenpotato 3 жыл бұрын
Best explanation!
@abdulmagedal-khulaifi6410
@abdulmagedal-khulaifi6410 3 жыл бұрын
Super useful, thank you 💙
@streetzstudio100
@streetzstudio100 5 жыл бұрын
I refuse to learn .net core because you have not done a tutorial on it. Now that you have done? and now that i have seen your tutorial to this level, i can say that you are the best .net instructor in the whole world
@MmMm-tg5mq
@MmMm-tg5mq 5 жыл бұрын
simply, great
@AbuSayed-gf8gt
@AbuSayed-gf8gt 3 жыл бұрын
Great
@robertmays6097
@robertmays6097 5 жыл бұрын
very clear nicely put
@gizzmo1976
@gizzmo1976 4 жыл бұрын
Well done!
@iyerpram
@iyerpram 5 жыл бұрын
Thanks for sharing this
@krzysztofhandzlik9273
@krzysztofhandzlik9273 5 жыл бұрын
Thumbs up!
@deepakkumarprajapati8823
@deepakkumarprajapati8823 2 жыл бұрын
awesome
@salmanchowdarym1110
@salmanchowdarym1110 5 жыл бұрын
Great video
@Sagricon
@Sagricon 5 жыл бұрын
In most of the cases you may not want to change the url if you rename the class name or function name of controller. Since it would be a breaking change for the clients.
@debugville2972
@debugville2972 5 жыл бұрын
Please discuss OAuth and Web API versioning.
@josedejesuslopezdiaz
@josedejesuslopezdiaz 5 жыл бұрын
Yes plz Oauth2 flows
@ymtan
@ymtan 5 жыл бұрын
Hi Venkat, I would like to ask regarding the token replacement in attribute routing. When we navigate to URL (localhost:15410/home), the Index action method is executed and we are able to see the list of employees. You mentioned that is because of the [Route("")] attribute on the Index action method working in combination with the [Route("[controller]")] attribute on the HomeController. Notice in the URL we have the path "home", so the [controller] token is replaced with "home". However, I don't understand what do you mean we made the Index action within the HomeController the default action by including an empty route template [Route("")] ???
@karuppiahck
@karuppiahck 4 жыл бұрын
@Kudvenkat : In controller level, Can we use Route["Home/"] to avoid one more route in action method!?
@karimmessaoud3191
@karimmessaoud3191 4 жыл бұрын
Thank you very much!
@mrmoinn
@mrmoinn 5 жыл бұрын
So does the attribute route override the route generated by the UseMvc() conventional method?
@carlosgarcia8107
@carlosgarcia8107 4 жыл бұрын
What is the best practice, use the config settings or use the attrib path?. If I have a lot of controllers and actions it's better to have all the routing in one place (centralized) or specify for each controller and action (distributed)?
@deepakpandey9406
@deepakpandey9406 3 жыл бұрын
Best Practices, well it depends on your situation and project that you are working, basically when you are building Web Api project, you should use attribute routing, because it gives your controller and action level control for url. Conventional routing when you are building web application. Well, you could also customize your url using conventional based approach.
@javaguitarist
@javaguitarist 4 жыл бұрын
The null-coalescing C# operator "??" did not work in my code. I looked it up, and this is because it was only introduced in C# v8.0.
@coolwaterdvr
@coolwaterdvr 5 жыл бұрын
Thanks Venkat.
@AlThePal78
@AlThePal78 3 жыл бұрын
um what is the advantage of this if you can do something like [HttpGet("Controller/Action/{ID}")] and then in your view you can access it like Show One I am asking because this is how I learned how to do it in my coding bootcamp so trying to figure out what is the best route to go :)
@fennelsoft
@fennelsoft 5 жыл бұрын
is there a way to navigate to a specific action when a navigation link is clicked without changing the url. like url= localhost:5544 and url = localhost:5544
@kristiyanivanov7414
@kristiyanivanov7414 3 жыл бұрын
Thanks!
@JayJay-nb1sv
@JayJay-nb1sv 4 жыл бұрын
For net core 3, if you want to use endpoints use app.UseEndpoints(endpoints => { endpoints.MapControllers(); });
@KevinMullarkey
@KevinMullarkey 4 жыл бұрын
How can i get the person's name to show in the show in the url optionally to the default id? i.e ...myhost://home/James as well as myhost://home/1 I am using Core 2.1 Thanks
@miraj0072004
@miraj0072004 5 жыл бұрын
Kudvenkat and Chill
@wassemalaabid6061
@wassemalaabid6061 5 жыл бұрын
Perfektion
@GG9K71
@GG9K71 4 жыл бұрын
Why to use [Route] attribute on an action method when you can use HTTP Verb method?
@saravana8796
@saravana8796 3 жыл бұрын
Sir I am getting 404 error while giving like this : localhost:64947/Home/Index, I have implemented the same like you
@salomonks-francais6752
@salomonks-francais6752 5 жыл бұрын
I am the first to comment today
@Sysshad
@Sysshad 5 жыл бұрын
Im the first to comment the first comment today :)
@kumarshrey209
@kumarshrey209 3 жыл бұрын
6 May 2021
@tothedust
@tothedust 5 жыл бұрын
Dear sir one request can you please put number with title in videos
@mrmoinn
@mrmoinn 5 жыл бұрын
It's all in a playlist anyways for easy viewing and the number is in the thumbnail of the video
Install and use Bootstrap in ASP NET Core
11:29
kudvenkat
Рет қаралды 149 М.
Routing in ASP NET Core MVC
12:01
kudvenkat
Рет қаралды 192 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
coco在求救? #小丑 #天使 #shorts
00:29
好人小丑
Рет қаралды 120 МЛН
黑天使被操控了#short #angel #clown
00:40
Super Beauty team
Рет қаралды 61 МЛН
AddSingleton vs AddScoped vs AddTransient
15:23
kudvenkat
Рет қаралды 218 М.
What is Dependency Injection in .NET?
7:31
DotNetMastery
Рет қаралды 29 М.
ASP NET Core dependency injection tutorial
9:28
kudvenkat
Рет қаралды 434 М.
How to Implement Refresh Token in ASP.NET Core Web API
14:49
Code Maze
Рет қаралды 12 М.
Swagger in ASP.Net Core (Using Swashbuckle.AspNetCore NuGet Package)
12:07
DotNet Core Central
Рет қаралды 44 М.
ViewBag in ASP NET Core MVC
6:38
kudvenkat
Рет қаралды 126 М.