public void insertCoach(CoachDTO coachDTO) { context.user.Add(coachDTO.toUser()); context.SaveChanges(); context.coach.Add(coachDTO.toCoach()); context.SaveChanges(); }
public void insertCoach(CoachDTO coachDTO) { var userAdded = context.user.Add(coachDTO.toUser()); context.SaveChanges(); coachDTO.userId = userAdded.id; context.coach.Add(coachDTO.toCoach()); context.SaveChanges(); }