public ActionResult Create(Recomendacion recomendacion)
        {
            if (ModelState.IsValid)
            {
                db.Recomendacion.Add(recomendacion);
                db.SaveChanges();
                return RedirectToAction("Index");
            }

            ViewBag.idCategoria = new SelectList(db.CategoriaRecomendacion, "idCategoria", "nombre", recomendacion.idCategoria);
            return View(recomendacion);
        }
        // POST api/Recomendacion
        public HttpResponseMessage PostRecomendacion(Recomendacion recomendacion)
        {
            if (ModelState.IsValid)
            {
                db.Recomendacion.Add(recomendacion);
                db.SaveChanges();

                HttpResponseMessage response = Request.CreateResponse(HttpStatusCode.Created, recomendacion);
                response.Headers.Location = new Uri(Url.Link("DefaultApi", new { id = recomendacion.idRecomendacion }));
                return response;
            }
            else
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }
        }
        // PUT api/Recomendacion/5
        public HttpResponseMessage PutRecomendacion(int id, Recomendacion recomendacion)
        {
            if (!ModelState.IsValid)
            {
                return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ModelState);
            }

            if (id != recomendacion.idRecomendacion)
            {
                return Request.CreateResponse(HttpStatusCode.BadRequest);
            }

            db.Entry(recomendacion).State = EntityState.Modified;

            try
            {
                db.SaveChanges();
            }
            catch (DbUpdateConcurrencyException ex)
            {
                return Request.CreateErrorResponse(HttpStatusCode.NotFound, ex);
            }

            return Request.CreateResponse(HttpStatusCode.OK);
        }
 public ActionResult Edit(Recomendacion recomendacion)
 {
     if (ModelState.IsValid)
     {
         db.Entry(recomendacion).State = EntityState.Modified;
         db.SaveChanges();
         return RedirectToAction("Index");
     }
     ViewBag.idCategoria = new SelectList(db.CategoriaRecomendacion, "idCategoria", "nombre", recomendacion.idCategoria);
     return View(recomendacion);
 }