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); }
public ActionResult FindById(int?id) { CustomerByIdViewModel customer = this.service.FindById(id); return(this.View(customer)); }