Why to use DTO (Data Transfer Objects)

Поделиться
HTML-код
  • Опубликовано: 23 окт 2020
  • At present we are Exposing database entities to the client, but that is not always a good idea. Sometimes you want to change the shape of the data that you send to client. For example, you might want to:
    - Remove circular references (see previous section).
    - Hide particular properties that clients are not supposed to view.
    - Omit some properties in order to reduce payload size.
    - Flatten object graphs that contain nested objects, to make them more convenient for clients.
    - Avoid "over-posting" vulnerabilities. (See Model Validation for a discussion of over-posting.)
    - Decouple your service layer from your database layer.
    DTO will help us to resolve all the above issues. In this video we will understand it in details. .
    You can support me by donating on
    www.buymeacoffee.com/studymash
    Thanks
    Studymash

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

  • @FisayoOluwayemi
    @FisayoOluwayemi 3 года назад +2

    please when is this course going to end ? like when are you going to deploy the back end code to Azure?

    • @StudyMash
      @StudyMash  3 года назад +3

      I think 5 more videos to go before releasing this on azure.

  • @iancarr3923
    @iancarr3923 2 года назад +3

    This is an excellent video - the best I have seen on DTO's so far. Video is also excellent.

  • @dalilapramenkovic8597
    @dalilapramenkovic8597 2 года назад +2

    I just wanted to THANK YOU for this series of tutorials. You have helped me sooo much! You have such a good way of explaining things at easy way.
    I really appreciate this course and I really appreciate you have posted this for free at YT.

  • @harisharis-jw8ff
    @harisharis-jw8ff 11 месяцев назад +1

    i have not seen a teacher like u thank u

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

    Muy bien explicado mister Mash....gracias

  • @sajad5644
    @sajad5644 3 года назад +1

    i found great tutorials in your channel , tanx sir

  • @harisharis-jw8ff
    @harisharis-jw8ff 11 месяцев назад +1

    thanks a lot you are the best teacher

  • @noobtube5555
    @noobtube5555 3 года назад +1

    Keep up the good work

  • @ReyAlexam
    @ReyAlexam 3 года назад +1

    great and detailed explanation , thnx

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

    Best portion of WebAPI with repository pattern and Unit of work implementation , I feel you should extract the WebAPI portion of this tutorial and combine it in a single video and upload it , so that if some one search web api with repo pattern and unit of work he can find easily your tutorial .

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

    Thank you for this video, made things more clear for me. I still have a question, where should the controller objects be instantiated? In a class as a field? in other places?

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

    what is the difference between DTO and ViewModel

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

    Hi Sandeep, thanks for the video. Can we copy data annotations (such as [Key] and [Column()] ) of the City model when moving some of its properties to the CityDto? Should CityDto have these annotations? Thanks.

    • @StudyMash
      @StudyMash  3 года назад +1

      Yes, that is absolutely okay to add data annotation on DTO.

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

      @@StudyMash Thank you!

  • @raman.thatikunta
    @raman.thatikunta 3 года назад

    Hey Sandeep, I'm now able to debug WebAPI project. I tried to attach to "Launch Chrome against localhost", but that didn't work. What steps do I need to take to debug front end app? Thanks.

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

      Why you are attaching it to Chrome, you need to attach the .exe of your application executing your application as suggested in this video.

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

    Do you have any github repo with this project?

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

      github.com/webtrainer-in/HSPA