public ActionResult Create(EstadoPista estadopista)
        {
            if (ModelState.IsValid)
            {
                db.EstadoPista.AddObject(estadopista);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            return View(estadopista);
        }
 public ActionResult Edit(EstadoPista estadopista)
 {
     if (ModelState.IsValid)
     {
         db.EstadoPista.Attach(estadopista);
         db.ObjectStateManager.ChangeObjectState(estadopista, EntityState.Modified);
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     return View(estadopista);
 }
 /// <summary>
 /// Create a new EstadoPista object.
 /// </summary>
 /// <param name="id">Initial value of the ID property.</param>
 /// <param name="nombre">Initial value of the Nombre property.</param>
 /// <param name="estado">Initial value of the Estado property.</param>
 public static EstadoPista CreateEstadoPista(global::System.Int32 id, global::System.String nombre, global::System.Boolean estado)
 {
     EstadoPista estadoPista = new EstadoPista();
     estadoPista.ID = id;
     estadoPista.Nombre = nombre;
     estadoPista.Estado = estado;
     return estadoPista;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the EstadoPista EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToEstadoPista(EstadoPista estadoPista)
 {
     base.AddObject("EstadoPista", estadoPista);
 }