Exemplo n.º 1
0
        public PartialViewResult UpdateVirarium()
        {
            CreateMap<Connection, ConnectionViewModel>();
            CreateMap<Infection, InfectionViewModel>();
            CreateMap<Machine, MachineViewModel>();
            CreateMap<NIC, NICViewModel>();
            CreateMap<Virus, VirusViewModel>();
            CreateMap<VLan, VLanViewModel>();

            var viewModel = new IndexViewModel();
            viewModel.Machines = Map<Machine, MachineViewModel>(MachineService.GetAll());
            viewModel.VLans = Map<VLan, VLanViewModel>(VLanService.GetAll());

            return PartialView("ViewObjects/Virarium", viewModel);
        }
Exemplo n.º 2
0
        public ActionResult Index()
        {
            CreateMap<Connection, ConnectionViewModel>();
            CreateMap<Infection, InfectionViewModel>();
            CreateMap<Machine, MachineViewModel>();
            CreateMap<NIC, NICViewModel>();
            CreateMap<Virus, VirusViewModel>();
            CreateMap<VLan, VLanViewModel>();

            var viewModel = new IndexViewModel();
            viewModel.Machines = Map<Machine, MachineViewModel>(MachineService.GetAll());
            viewModel.VLans = Map<VLan, VLanViewModel>(VLanService.GetAll());

            return View(viewModel);
        }