public void Edit(TeammateDTO teammate) { var mapper = new MapperConfiguration(cfg => { cfg.CreateMap <TeammateDTO, Teammate>(); }).CreateMapper(); _unitOfWork.Teammates.Update(mapper.Map <TeammateDTO, Teammate>(teammate)); }
public void AddUsers(PersonDTO person, ProjectDTO project) { TeammateDTO teammateDTO = new TeammateDTO() { IdPerson = person.Id, IdProject = project.Id }; var mapper = new MapperConfiguration(cfg => { cfg.CreateMap <TeammateDTO, Teammate>(); }).CreateMapper(); Database.Teammates.Create(mapper.Map <TeammateDTO, Teammate>(teammateDTO)); }