/// <summary> /// Create a new Task object. /// </summary> /// <param name="taskID">Initial value of the TaskID property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="projectID">Initial value of the ProjectID property.</param> public static Task CreateTask(global::System.Int32 taskID, global::System.String name, global::System.Int32 projectID) { Task task = new Task(); task.TaskID = taskID; task.Name = name; task.ProjectID = projectID; return task; }
public ActionResult Edit(int id, Task task) { if (!ModelState.IsValid) return View(); try { UpdateModel(GetTaskByID(id)); _dataModel.SaveChanges(); return RedirectToAction("Index"); } catch { return RedirectToAction("Index"); } }
/// <summary> /// Deprecated Method for adding a new object to the Tasks EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToTasks(Task task) { base.AddObject("Tasks", task); }