예제 #1
0
        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));
        }
예제 #2
0
        public ActionResult UploadFile()
        {
            UploadContactModel model = new UploadContactModel();

            return(View(model));
        }