예제 #1
0
        public FileUserModel(FileUser model)
        {
            //Mapper.CreateMap<FileUser, FileUserModel>()
            //    .ForMember(m => m.Address, d => d.MapFrom(f => (f.Address ?? string.Empty).Split('\n')));

            Name = model.Name;
            Age = model.Age;
            Address = (model.Address ?? string.Empty).Split('\n').ToList();
        }
예제 #2
0
 public ActionResult CreateFileUser(FileUser model)
 {
     try
     {
         var fileUser = new FileUserModel(model);
         Context.FileUsers.Insert(fileUser);
         return RedirectToAction("Index");
     }
     catch
     {
         return View();
     }
 }
예제 #3
0
 // GET: Mongo/Create
 public ActionResult CreateFileUser()
 {
     FileUser user = new FileUser();
     return View(user);
 }