Attribute Routing in ASP NET Core MVC

Поделиться
HTML-код
  • Опубликовано: 10 сен 2024

Комментарии • 52

  • @Andrew-ht7rf
    @Andrew-ht7rf 4 года назад +17

    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 года назад +4

    You are just a legend sir.. I was searching for routing tutorials very badly.. You just nailed it!

  • @vinzer72frie
    @vinzer72frie 5 лет назад +13

    I am glad to see you're staying fresh with the new tech including net core keep the good work

  • @fleurarkesteijn5122
    @fleurarkesteijn5122 3 года назад +4

    Love how thorough, clear and calm you explain everything!

  • @barney8545
    @barney8545 4 года назад +1

    The best .net core tutorial on RUclips

  • @1980goutam
    @1980goutam 5 лет назад +2

    I really like the video. It help me lot to learn thank you very much to make such wonderful tutorial.

  • @TheWestDESIGN
    @TheWestDESIGN 5 лет назад +11

    Binge watched the whole series. It's amazing, keep it up! :)

  • @MicroftHunter
    @MicroftHunter 4 года назад

    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

  • @aszuts
    @aszuts 2 года назад

    Very nice and clear explanation of attribute routing! (Y)

  • @chillbro2275
    @chillbro2275 4 года назад +1

    Wow cool feature, and well explained and demonstrated!

  • @lastkingssaint4609
    @lastkingssaint4609 Год назад

    Once again, excellent tutorials!

  • @deepakha9759
    @deepakha9759 2 года назад

    Crystal clear explanation!

  • @deepakkumarprajapati8823
    @deepakkumarprajapati8823 Год назад

    awesome

  • @sylviur
    @sylviur 3 года назад

    Thank you for this wonderful presentations.

  • @streetzstudio100
    @streetzstudio100 5 лет назад +1

    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

  • @MyGreenpotato
    @MyGreenpotato 2 года назад

    Best explanation!

  • @DarkCloud7
    @DarkCloud7 4 года назад +2

    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) {...}

  • @abdulmagedal-khulaifi6410
    @abdulmagedal-khulaifi6410 3 года назад

    Super useful, thank you 💙

  • @debugville2972
    @debugville2972 5 лет назад +4

    Please discuss OAuth and Web API versioning.

  • @javaguitarist
    @javaguitarist 4 года назад +1

    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.

  • @gizzmo1976
    @gizzmo1976 4 года назад

    Well done!

  • @robertmays6097
    @robertmays6097 5 лет назад

    very clear nicely put

  • @krzysztofhandzlik9273
    @krzysztofhandzlik9273 5 лет назад

    Thumbs up!

  • @salmanchowdarym1110
    @salmanchowdarym1110 5 лет назад

    Great video

  • @kristiyanivanov7414
    @kristiyanivanov7414 3 года назад

    Thanks!

  • @AbuSayed-gf8gt
    @AbuSayed-gf8gt 3 года назад

    Great

  • @MmMm-tg5mq
    @MmMm-tg5mq 5 лет назад

    simply, great

  • @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("")] ???

  • @karimmessaoud3191
    @karimmessaoud3191 4 года назад

    Thank you very much!

  • @fennelsoft
    @fennelsoft 4 года назад

    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

  • @iyerpram
    @iyerpram 5 лет назад

    Thanks for sharing this

  • @karuppiahck
    @karuppiahck 4 года назад

    @Kudvenkat : In controller level, Can we use Route["Home/"] to avoid one more route in action method!?

  • @mrmoinn
    @mrmoinn 5 лет назад

    So does the attribute route override the route generated by the UseMvc() conventional method?

  • @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 :)

  • @KevinMullarkey
    @KevinMullarkey 3 года назад

    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

  • @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 года назад +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.

  • @coolwaterdvr
    @coolwaterdvr 5 лет назад

    Thanks Venkat.

  • @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.

  • @miraj0072004
    @miraj0072004 4 года назад +1

    Kudvenkat and Chill

  • @wassemalaabid6061
    @wassemalaabid6061 4 года назад

    Perfektion

  • @GN9K71
    @GN9K71 3 года назад

    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

  • @JayJay-nb1sv
    @JayJay-nb1sv 4 года назад

    For net core 3, if you want to use endpoints use
    app.UseEndpoints(endpoints =>
    {
    endpoints.MapControllers();
    });

  • @kumarshrey209
    @kumarshrey209 3 года назад

    6 May 2021

  • @tothedust
    @tothedust 5 лет назад +1

    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

  • @salomonks-francais6752
    @salomonks-francais6752 5 лет назад

    I am the first to comment today

    • @Sysshad
      @Sysshad 5 лет назад

      Im the first to comment the first comment today :)