コード例 #1
0
        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);
        }
コード例 #2
0
 /// <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;
 }
コード例 #3
0
 /// <summary>
 /// Deprecated Method for adding a new object to the Servicios EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToServicios(Servicio servicio)
 {
     base.AddObject("Servicios", servicio);
 }