public ActionResult Create(ServicioVM servicioVM) { Servicio servicio = new Servicio(); if (ModelState.IsValid) { Mapper.Map(servicioVM, servicio); repository.Add(servicio); repository.Save(); return RedirectToAction("Index"); } return View(servicioVM); }
/// <summary> /// Create a new Servicio object. /// </summary> /// <param name="servicioId">Initial value of the ServicioId property.</param> /// <param name="nombre">Initial value of the Nombre property.</param> /// <param name="fechaCreacion">Initial value of the FechaCreacion property.</param> /// <param name="baja">Initial value of the Baja property.</param> public static Servicio CreateServicio(global::System.Int32 servicioId, global::System.String nombre, global::System.DateTime fechaCreacion, global::System.Boolean baja) { Servicio servicio = new Servicio(); servicio.ServicioId = servicioId; servicio.Nombre = nombre; servicio.FechaCreacion = fechaCreacion; servicio.Baja = baja; return servicio; }
/// <summary> /// Deprecated Method for adding a new object to the Servicios EntitySet. Consider using the .Add method of the associated ObjectSet<T> property instead. /// </summary> public void AddToServicios(Servicio servicio) { base.AddObject("Servicios", servicio); }