Ambiguity error Asp.net mvc

Asked

Viewed 50 times

0

Erro de ambiguidade

with this controller:

  public ActionResult Create([Bind(Include = "ImagemId,Image,ImagemTipo")]Imagem imagem,List <HttpPostedFileBase> upload)
    {

        if(upload != null && upload.Count> 0) {


            foreach (HttpPostedFileBase file in upload)
            {
                var arqImagem = new Imagem
                {
                    ImagemTipo = file.ContentType
                };
                using (var reader = new BinaryReader(file.InputStream))
                {
                    arqImagem.Image = reader.ReadBytes(file.ContentLength);
                }
                imagem.Image = arqImagem.Image;
                imagem.ImagemTipo = arqImagem.ImagemTipo;

                db.Imagems.Add(imagem);
                db.SaveChanges();
            }
        }


        return View(imagem);
    }

I got this error: that I couldn’t solve

1 answer

0


Doesn’t have 2 ActionResult with the same name no? If yes, the arguments are not enough to differentiate the 2.

  • Thanks, I got it solved. How do I proceed? how to close the question?

  • @Rafaelg, here you only need to accept the answer you think best, it is not necessary to close. You can also give a UP Vote to those who helped you. :)

Browser other questions tagged

You are not signed in. Login or sign up in order to post.