public WorkshopEntityViewModel MapToViewModel(Workshop model)
 {
     var workshopViewModel = new WorkshopEntityViewModel();
     if(model!=null)
     {
         workshopViewModel.Id = model.WorkshopID;
         workshopViewModel.Name = model.Name;
         if (model.Manager != null)
         {
             workshopViewModel.ManagerId = model.Manager.UserID;
             workshopViewModel.ManagerName = model.Manager.Fullname;
         }
         if (model.Team != null)
         {
             workshopViewModel.TeamName = model.Team.Name;
             workshopViewModel.TeamId = model.Team.TeamID;
         }
     }
     return workshopViewModel;
 }
 public void MapToModel(WorkshopEntityViewModel entityViewModel, Workshop model, bool includeManager)
 {
     model.Name = entityViewModel.Name;
     if(includeManager) model.Manager = _userRepository.GetByID((int)entityViewModel.ManagerId);
     model.Team = _teamRepository.GetByID((int)entityViewModel.TeamId);
 }
 public void MapToModel(WorkshopEntityViewModel entityViewModel, Workshop model)
 {
     MapToModel(entityViewModel, model, true);
 }