How to retrieve an Entity when using AutoMapper

Alesia

Guest
I use MVC in Asp.net using AutoMapper.As you can see from this code\[code\] Event eventObj = Mapper.Map<EventEditViewModel, Event>(eventEditViewModel);\[/code\]I'm trying to convert map EventEditViewModel to Event.I would need need to use my Service layer to convert the CandidateId to an actual Entity.Any idea if it is possible to do this in AutoMapper? how to setup itpublic class Event() { public Class Candidate {get; set;} }\[code\]public class EventEditViewModel(){ public string CandidateId {get; set;}}\[/code\]
 
Back
Top