I had an Entity named User that can have many services (Entity Service) and I have two actions one of them with the name GetUser() and the other with name GetUserServices()
public class UserDto
{
public int Id {get;set;}
public string Username {get;set;}
}
You can use either ways. If you use separate DTO per operation - it's a lot of code writing (and time spending). I prefer to use one DTO for similar operations as long as they are readable and flexible and create additional if needed.
For more information have a look in this doc.You can find here some basic principles, pros and cons of DTO.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.