public IHttpActionResult AddParentIntoChildCard(AddParentChildCardVM parentChildCardVM) { if (!ModelState.IsValid) { return(BadRequest(ModelState)); } var parentChildCardDTO = ChildCardMapHelper.VMToDTO(parentChildCardVM); var result = _childCardsService.AddParentIntoChildCard(parentChildCardDTO); return(Ok(result)); }
public static ParentChildCardDTO VMToDTO(AddParentChildCardVM parentVM) { Mapper.Initialize(cfg => cfg.CreateMap <AddParentChildCardVM, ParentChildCardDTO>()); return(Mapper.Map <ParentChildCardDTO>(parentVM)); }