This is by design, since having a DTO write back to e.g. a domain model would (among other things) take away its immutability, and is often considered an anti-pattern.
这需要通过设计完成,因为让DTO回写到,比方说:域模型或其他东西,就会更改它的持久性,同时人们也认为它是反模式的。
We'll use it as a DTO here, but it should be evident that it doesn't matter where it came from - it's acceptable to work in terms of your domain, if you want.
我们在这里把它作为DTO来用,但很显然,它来自哪里并不重要——如果你愿意,根据你的领域去处理它也可以。
Writing the domain object to DTO mapping code is tedious.
域对象写入DTO映射代码是非常枯燥。
应用推荐