public IViewComponentResult Invoke(int customerProfileId) { var customer = _customerService.GetCustomerById(customerProfileId); if (customer == null) { throw new ArgumentNullException(nameof(customer)); } var model = _profileModelFactory.PrepareProfileInfoModel(customer); return(View(model)); }
public virtual ActionResult Info(int customerProfileId) { var customer = _customerService.GetCustomerById(customerProfileId); if (customer == null) { return(RedirectToRoute("HomePage")); } var model = _profileModelFactory.PrepareProfileInfoModel(customer); return(PartialView(model)); }