コード例 #1
0
        public ActionResult SimpleMapping()
        {
            var person = new Person() { FirstName = "Sunil", LastName = "Munikar" };
            PersonViewModel personVm = Mapper.Map<Person, PersonViewModel>(person);

            return View(personVm);
        }
コード例 #2
0
        public ActionResult CustomMapping()
        {
            var person = new Person() { FirstName = "Sunil", LastName = "Munikar" };
            CustomerViewModel customerVm = Mapper.Map<Person, CustomerViewModel>(person);

            return View(customerVm);
        }