草庐IT

AfterMap

全部标签

c# - 如何使用 AfterMap 将属性映射到集合属性

我有两个实体和两个DTO。我正在将实体映射到DTO。DTO的简化版本如下所示:publicclassFooDto{//Otherpropertiesremovedforclarity.publicstringDescription{get;set;}publicdecimalTotal{get;set;}publicICollectionBars{get;set;}}publicclassBarDto{//Otherpropertiesremovedforclarity.publicdecimalTotal{get;set;}}Foo和Bar类是:publicclassFoo{publ