Это видео недоступно.
Сожалеем об этом.

ASP.NET Core Web API .NET 8 2024 - 7. PUT (Update)

Поделиться
HTML-код
  • Опубликовано: 6 янв 2024
  • ASP.NET Core Web API .NET 8 2024 - 7. PUT (Update)
    Github repo for course: github.com/teddysmithdev/FinS...
    Twitter: / teddysmithdev
    Github: github.com/teddysmithdev
    Linkedin: / teddy-smith-015ba61a3

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

  • @rahulpatwadi5649
    @rahulpatwadi5649 4 дня назад

    Hey Ted, love your explanation! You help us understand it in a simpler way with your analogies. Thank you, and looking forward for more .NET stuff.

  • @Kamilek96
    @Kamilek96 6 месяцев назад +6

    Another approach would be to use: _ctx.Entry(entity).CurrentValues.SetValues(dto); instead of manual mapping :) Thanks for your effort on this series!

    • @TeddySmithDev
      @TeddySmithDev  6 месяцев назад +3

      just found out about this. sweet!

    • @SkyRosh
      @SkyRosh 4 месяца назад

      Why it's like you are trying to create a template of entity mapping if am confused

  • @tarekabiramia913
    @tarekabiramia913 6 месяцев назад +1

    Killing it as always man 🔥🔥
    keep going

  • @eatersdaily
    @eatersdaily 3 месяца назад

    We are good to go!

  • @kvelez
    @kvelez 3 месяца назад

    Fascinating

  • @walidaguib3944
    @walidaguib3944 4 месяца назад +2

    why we can't use _context.Stock.update()?

  • @maxiphobos
    @maxiphobos 6 месяцев назад +1

    How about EF method AddOrUpdate? It significantly reduces code where you can just put entity Id into the body's DTO and solve both add/update operations in one line (if mapping is not required). But, of course, in this particular case it should be only one POST AddOrUpdate method, which is not bad, in my opinion. What do you think?

    • @TeddySmithDev
      @TeddySmithDev  6 месяцев назад +1

      (opinion) Will work great for small project but will become a pain as app grows bigger and you have to do little logic checks on data coming in. But you may create something cool so don't let me stop you lol

    • @jayakumar2927
      @jayakumar2927 6 месяцев назад

      @@TeddySmithDev Can you angular as well

  • @BDCPT-amPhiHoang
    @BDCPT-amPhiHoang 4 месяца назад

    Why dont you use a dto to model mapper for update like what you did with create? Is it just because AddAsync() not accept DTO models?