public ActionResult CrearPost(Post c, HttpPostedFileBase imagenSisi) { UserPosterClient posterClient = new UserPosterClient(); var elemento = posterClient.FindByCorreo(User.Identity.Name); c.Poster = elemento.Id; PostClient postClient = new PostClient(); if (imagenSisi != null && imagenSisi.ContentLength > 0) { byte[] imagenData = null; using (var bynaryImage = new BinaryReader(imagenSisi.InputStream)) { imagenData = bynaryImage.ReadBytes(imagenSisi.ContentLength); } c.Logo = imagenData; } if (c.NombreCategoria == 0) { return(CrearPost("Debes seleccionar una Categoria.")); } else if (c.NombrePais == 0 || c.NombreCiudad == 0) { return(CrearPost("Debes seleccionar un pais y su ciudad correspondiente.")); } else if (c.NombreTipoTrabajo == 0) { return(CrearPost("Debes seleccionar un tipo de Trabajo.")); } else { if (ModelState.IsValid) { postClient.Add(c); return(RedirectToAction("ProfileAcc")); } else { return(View(c)); } } }