Esempio n. 1
0
        public CustomerByIdViewModel FindById(int?id)
        {
            if (id == null)
            {
                id = 1;
            }

            Customer customer = this.Context.Customers.FirstOrDefault(c => c.Id == id);

            CustomerByIdViewModel customerVm = Mapper.Map <Customer, CustomerByIdViewModel>(customer);

            return(customerVm);
        }
Esempio n. 2
0
        public ActionResult FindById(int?id)
        {
            CustomerByIdViewModel customer = this.service.FindById(id);

            return(this.View(customer));
        }