예제 #1
0
        public ActionResult Create(TaskModel task)
        {
            if (!ModelState.IsValid)
            {
                return(View(task));
            }
            else
            {
                context.Insert(task);
                context.Commit();

                return(RedirectToAction("Index"));
            }
        }
예제 #2
0
        public void Create(TaskModel taskModel)
        {
            TaskRepository taskRepository = new TaskRepository();

            taskRepository.AddTask(taskModel.MapTask());
            taskRepository.Commit();
        }