// GET: Produto/Create public async Task <ActionResult> Create() { var hortas = await _clientHelper.GetHortasAsync(); var model = new ProdutoBindingModel(); foreach (var item in hortas) { var SelectItem = new SelectListItem() { Value = item.Id.ToString(), Text = item.Titulo }; model.Hortas.Add(SelectItem); } return(View(model)); }
// GET: Horta public async Task <ActionResult> Index() { var model = await _clientHelper.GetHortasAsync(); foreach (var item in model) { var perfil = await _clientHelper.GetPerfilAsync(item.PerfilId); item.PerfilNome = perfil.Nome; } return(View(model)); }