Why to use DTO (Data Transfer Objects)

Поділитися
Вставка
  • Опубліковано 27 вер 2024
  • 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.buymeacoff...
    Thanks
    Studymash

КОМЕНТАРІ • 24

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

  • @dalilapramenkovic8597
    @dalilapramenkovic8597 3 роки тому +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 Рік тому +1

    i have not seen a teacher like u thank u

  • @sajad5644
    @sajad5644 3 роки тому +1

    i found great tutorials in your channel , tanx sir

  • @josbexerra8115
    @josbexerra8115 2 роки тому

    Muy bien explicado mister Mash....gracias

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

  • @iancarr3923
    @iancarr3923 2 роки тому +3

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

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

  • @satyamverma6029
    @satyamverma6029 Місяць тому

    Sir actually when i configured my iis server and used DTO the id for bew values are adding from 1014,1015 like this. Kindly help me with this please.

    • @StudyMash
      @StudyMash  Місяць тому

      You must not be typecasting value to int and that is causing your incremental id to concatenate with older one instead of adding.

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

  • @destinycookfera9037
    @destinycookfera9037 5 днів тому

    Brown James Garcia Paul Brown Michael

  • @harisharis-jw8ff
    @harisharis-jw8ff Рік тому +1

    thanks a lot you are the best teacher

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

  • @lcantillo84
    @lcantillo84 2 роки тому

    Do you have any github repo with this project?

    • @StudyMash
      @StudyMash  2 роки тому

      github.com/webtrainer-in/HSPA