示例#1
0
        public CompetitieViewModel GetCompetitieViewModelByLandId(int argLandId)
        {
            CompetitieModel compM = _competitieRepo.GetCompetitieByLandID(argLandId);
            CompetitieViewModel compVM = new CompetitieViewModel(compM);

            //Get the managerCompetitieModel
            ManagerCompetitieModel managerCompetitieModel = _managerCompetitieRepo.GetManagerCompetitieModel(compM.Competitie_ID);
            compVM.ManagerPunten = managerCompetitieModel.ManagerPunten;

            //Get the landVM
            LandModel lModel = compM.LandModel;
            LandViewModel lVM = new LandViewModel(lModel);
            //Get the managerVM
            ManagerModel mModel = compM.ManagerModel;
            ManagerViewModel managerVM = new ManagerViewModel(mModel);
            //Set them in the compVM before returning.
            compVM.LandVM = lVM;
            compVM.ManaVM = managerVM;

            return compVM;
        }