// GET: Chamados/Edit/5 public async Task <IActionResult> Edit(int?id) { if (id == null) { return(NotFound()); } var chamados = await _context.Chamados.FindAsync(id); if (chamados == null) { return(NotFound()); } var TipoStatus = new List <SelectListItem>(); TipoStatus.Add(new SelectListItem { Text = "Selecionar", Value = "" }); foreach (Status i in Enum.GetValues(typeof(Status))) { TipoStatus.Add(new SelectListItem { Text = Enum.GetName(typeof(Status), i), Value = i.ToString() }); } ViewBag.TipoStatus = TipoStatus; var Usuario = _usuarioServices.FindAll(); var ListTest = new List <SelectListItem>(); ListTest.Add(new SelectListItem { Text = "Selecionar", Value = "" }); foreach (var Item in Usuario) { ListTest.Add(new SelectListItem { Text = Item.Nome, Value = Item.Id.ToString() }); } ViewBag.usuarios = ListTest; return(View(chamados)); }