I have a parameter on method
Func<UOMViewModel, dynamic> orderBy
and which I need to change to Func<UOM, dynamic> orderByToRepo
var config1 = new MapperConfiguration(cfg => { cfg.CreateMap<Func<UOMViewModel, dynamic>, Func<UOM, dynamic>>(); });
IMapper mapper1 = config1.CreateMapper();
var orderByToRepo= mapper1.Map<Func<UOMViewModel, dynamic>, Func<UOM, dynamic>>(orderBy);
IEnumerable<UOM> uoms = _uomRepository.GetAll(orderByToRepo, pageSize, pageNumber, sortOrder);
But while running the code I am getting error on line var orderByToRepo= mapper1.Map<Func<UOMViewModel, dynamic>, Func<UOM, dynamic>>(orderBy);
The error is
System.Func`2[Entities.Entities.UOM,System.Object] needs to have a constructor with 0 args or only optional args Parameter name: type
Is there anything I have missed. Please need help.
Thank you.
Hi Automapper Team,
Could you help me on this. Is there any other way to implement mapping logic.
Waiting for your response.
Thank you.
--
You received this message because you are subscribed to the Google Groups "AutoMapper-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to automapper-use...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--