public ActionResult Create(TaskModel task) { if (!ModelState.IsValid) { return(View(task)); } else { context.Insert(task); context.Commit(); return(RedirectToAction("Index")); } }
public void Create(TaskModel taskModel) { TaskRepository taskRepository = new TaskRepository(); taskRepository.AddTask(taskModel.MapTask()); taskRepository.Commit(); }