예제 #1
0
        public ActionResult Create(TeachersViewModel model, HttpPostedFileBase imageFile)
        {
            if (ModelState.IsValid)
            {
                var teachers = mapper.Map <tblTeachers>(model);
                teachers.ImageLink = SaveImage(imageFile);
                teachersService.AddTeachers(teachers);

                return(RedirectToAction("Index"));
            }
            return(Create());
        }