how to map multiple OBJECTS to one object using AutoMapper - asp.net mvc 3

前端 未结 2 508
甜味超标
甜味超标 2020-12-14 12:15

Hi All / very new to Auto-Mapper. i can map one to one objects but was wondering is it possible to map multiple objects to one object or multiple objects to multiple object

2条回答
  •  粉色の甜心
    2020-12-14 12:41

    you can use modelMapper

    @Autowired
    private ModelMapper modelMapper;
    

    and in function

    Desination desination = modelMapper.map(obj1, Desination.class);
    modelMapper.map(obj2, desination);
    

提交回复
热议问题