// GET: CustomerController public ActionResult Index() { var customers = _repo.FindAll().ToList(); var model = _mapper.Map <List <Customer>, List <CustomerVM> >(customers); return(View(model)); }
public ActionResult sync_customer() { foreach (Context.Customer dbitem in RepoCustomer.FindAll()) { if (Repoptnr_mstr.FindByPK(dbitem.Id) == null) { Repoptnr_mstr.save(dbitem); } else { Context.ptnr_mstr dbptnr = Repoptnr_mstr.FindByPK(dbitem.Id); dbptnr.ptnr_name = dbitem.CustomerNama; Repoptnr_mstr.updateCustomer(dbptnr); } } return(RedirectToAction("Index")); }