public ActionResult Alta(Profesionales models, String ComboEsp ) { IEnumerable<int> Id = (from Desc in BaseDeDatos.Especialidades where ComboEsp.Equals(Desc.Descripcion) select Desc.IdEspec); ProfEsp proes = new ProfEsp(); proes.IdProfesional = models.IdProfesional; proes.IdEspec = Id.FirstOrDefault(); proes.Estado = "Habilitado"; BaseDeDatos.AddToProfEsp(proes); BaseDeDatos.AddToProfesionales(models); BaseDeDatos.SaveChanges(); return View(); }
/// <summary> /// Deprecated Method for adding a new object to the ProfEsp EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToProfEsp(ProfEsp profEsp) { base.AddObject("ProfEsp", profEsp); }
/// <summary> /// Create a new ProfEsp object. /// </summary> /// <param name="idProfesional">Initial value of the IdProfesional property.</param> /// <param name="idEspec">Initial value of the IdEspec property.</param> public static ProfEsp CreateProfEsp(global::System.Int32 idProfesional, global::System.Int32 idEspec) { ProfEsp profEsp = new ProfEsp(); profEsp.IdProfesional = idProfesional; profEsp.IdEspec = idEspec; return profEsp; }