Beispiel #1
0
        public ActionResult Create(ClassName classname)
        {
            if (ModelState.IsValid)
            {
                db.ClassNames.Add(classname);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(classname);
        }
Beispiel #2
0
 /// <summary>
 /// Create a new ClassName object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="name">Initial value of the Name property.</param>
 public static ClassName CreateClassName(global::System.Int32 id, global::System.String name)
 {
     ClassName className = new ClassName();
     className.Id = id;
     className.Name = name;
     return className;
 }
Beispiel #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the ClassNames EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToClassNames(ClassName className)
 {
     base.AddObject("ClassNames", className);
 }
Beispiel #4
0
 public ActionResult Edit(ClassName classname)
 {
     if (ModelState.IsValid)
     {
         db.Entry(classname).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(classname);
 }
Beispiel #5
0
 public void AddClass(ClassName className)
 {
     throw new NotImplementedException();
 }