public void Save(TvStaffViewModel viewModel) { var model = _mapper.Map <TvStaff>(viewModel); var citizen = _citizenRepository.GetByName(viewModel.Citizen.Name); model.Citizen = citizen; model.Channel = _userService.GetUser().TvStaff.Channel; _staffRepository.Save(model); }
public void SaveDirector(TvStaffViewModel viewModel) { var model = _mapper.Map <TvStaff>(viewModel); var citizen = _citizenRepository.GetByName(viewModel.Citizen.Name); model.Citizen = citizen; var channel = _channelRepository.GetByName(viewModel.Channel.Name); model.Channel = channel; _staffRepository.Save(model); }