public async Task <IActionResult> PutPortada(int id, Portada portada) { if (id != portada.Id) { return(BadRequest()); } _context.Entry(portada).State = EntityState.Modified; try { await _context.SaveChangesAsync(); } catch (DbUpdateConcurrencyException) { if (!PortadaExists(id)) { return(NotFound()); } else { throw; } } return(NoContent()); }
public async Task <ActionResult <Portada> > PostPortada(Portada portada) { _context.Portada.Add(portada); await _context.SaveChangesAsync(); return(CreatedAtAction("GetPortada", new { id = portada.Id }, portada)); }
static void Main(string[] args) { Portada portada = new Portada("\tHerencia"); Persona p = new Persona(); p.Nombre = "Oscar"; p.Telefono = 55730016; p.Direccion = "Pergoleros 91 C14 101"; p.ImprimirPersona(); Alumnos a = new Alumnos(309693185, "7to", 9.41); a.Nombre = "Mauro"; a.Direccion = "Donde asaltan y roban"; a.Telefono = 55788901; a.ImprimirPersona(); Alumnos b = new Alumnos("Pedro", "Lomas de San Anguel", 55730000, 10874591, "10to", 10); b.ImprimirPersona(); b.ImprimirAlumno(); Console.ReadKey(); //picturebox }
static void Main(string[] args) { #region Portada Portada portada = new Portada(" Clases y Arreglos"); #endregion Carga q1 = new Carga(5, 4, 3); Carga q2 = new Carga(2, 1, 0); Console.WriteLine(q1.Mg); q1.Px = 10; Console.WriteLine(q1.Px); Console.ReadKey(); }
static void Main(string[] args) { Portada portada = new Portada(" Manejo de Exepciones"); try { double a, b; Console.WriteLine("Ingresa el valor de a"); a = Convert.ToDouble(Console.ReadLine()); Console.WriteLine("Ingresa el valor de b"); b = Convert.ToDouble(Console.ReadLine()); double[] c = { 5, 5, 5, 5, 5 }; Console.WriteLine("El valor de c = {0}", c[0]); } //catch (Exception error) //{ // Console.WriteLine(error.Message); //} catch (IndexOutOfRangeException error) { Console.WriteLine(error.Message); } catch (FormatException error) { Console.WriteLine(error.Message); } finally { //Siempre se ejecuta Console.WriteLine("Estoy en el finally"); } Console.ReadLine(); }