public ActionResult Upload(HttpPostedFileBase file) { if (file != null && file.ContentLength > 0) { if (!Path.GetExtension(file.FileName).ToLower().Equals(".csv")) { throw new NotSupportedException("Upload of files, other then CSV, is not supported."); } List <Person> persons = PersonsFactory.Create(file.InputStream); persons.ForEach(x => this.m_dataPrivider.Add(x)); this.m_dataPrivider.Save(); } return(View(this.m_dataPrivider.GetUsers())); }
public Engine() { factory = new PersonsFactory(); people = new List <Person>(); }