public ActionResult UploadFile(UploadContactModel model) { if (ModelState.IsValid) { List <Contact> contactsToAdd = new List <Contact>(); FileToContactsConverter fileToContactsConverter = new FileToContactsConverter(new ContactConverter()); _contactService.AddContacts(fileToContactsConverter.Convert(model.File)); return(RedirectToAction("Index", "Contact")); } return(View(model)); }
public ActionResult UploadFile() { UploadContactModel model = new UploadContactModel(); return(View(model)); }