/// <summary> /// Create a new Subject object. /// </summary> /// <param name="id">Initial value of the ID property.</param> /// <param name="name">Initial value of the Name property.</param> /// <param name="timeStamp">Initial value of the TimeStamp property.</param> /// <param name="isDeleted">Initial value of the IsDeleted property.</param> public static Subject CreateSubject(global::System.String id, global::System.String name, global::System.Byte[] timeStamp, global::System.Boolean isDeleted) { Subject subject = new Subject(); subject.ID = id; subject.Name = name; subject.TimeStamp = timeStamp; subject.IsDeleted = isDeleted; return subject; }
/// <summary> /// Deprecated Method for adding a new object to the Subjects EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToSubjects(Subject subject) { base.AddObject("Subjects", subject); }
public ActionResult AddSubject(Subject subject) { db.Subjects.AddObject(subject); db.SaveChanges(); return RedirectToAction("Index","Subject"); }