Пример #1
0
 public ActionResult Edit(color color)
 {
     if (ModelState.IsValid)
     {
         db.colors.Attach(color);
         db.ObjectStateManager.ChangeObjectState(color, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(color);
 }
Пример #2
0
        public ActionResult Create(color color)
        {
            if (ModelState.IsValid)
            {
                db.colors.AddObject(color);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(color);
        }
Пример #3
0
 /// <summary>
 /// Create a new color object.
 /// </summary>
 /// <param name="id">Initial value of the id property.</param>
 public static color Createcolor(global::System.Int32 id)
 {
     color color = new color();
     color.id = id;
     return color;
 }
Пример #4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the colors EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddTocolors(color color)
 {
     base.AddObject("colors", color);
 }