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
please when is this course going to end ? like when are you going to deploy the back end code to Azure?
I think 5 more videos to go before releasing this on azure.
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.
i have not seen a teacher like u thank u
Thanks buddy
i found great tutorials in your channel , tanx sir
Muy bien explicado mister Mash....gracias
Keep up the good work
great and detailed explanation , thnx
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 .
This is an excellent video - the best I have seen on DTO's so far. Video is also excellent.
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?
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.
You must not be typecasting value to int and that is causing your incremental id to concatenate with older one instead of adding.
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.
Why you are attaching it to Chrome, you need to attach the .exe of your application executing your application as suggested in this video.
Brown James Garcia Paul Brown Michael
thanks a lot you are the best teacher
what is the difference between DTO and ViewModel
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.
Yes, that is absolutely okay to add data annotation on DTO.
@@StudyMash Thank you!
Do you have any github repo with this project?
github.com/webtrainer-in/HSPA