public async Task OnGet() { var t = Task.Run(() => _appServiceTipo.List()); await t; var s = Task.Run(() => _appServiceSetor.List()); await s; var p = Task.Run(() => _appServiceParceiro.List()); await p; if (t.Result != null) { TipoEventos = new SelectList(t.Result, nameof(Tipo.Nome), nameof(Tipo.Nome), null); } if (s.Result != null) { Setores = new SelectList(s.Result, nameof(Setor.Nome), nameof(Setor.Nome), null); } if (p.Result != null) { Parceiros = new SelectList(p.Result, nameof(Parceiro.Nome), nameof(Parceiro.Nome), null); } }
public async Task OnGet(Guid id) { var t = Task.Run(() => _appServiceTipo.List()); await t; var s = Task.Run(() => _appServiceSetor.List()); await s; var p = Task.Run(() => _appServiceParceiro.List()); if (t.Result != null) { TipoEventos = new SelectList(t.Result, nameof(Tipo.Nome), nameof(Tipo.Nome), null); } if (s.Result != null) { Setores = new SelectList(s.Result, nameof(Setor.Nome), nameof(Setor.Nome), null); } if (p.Result != null) { Parceiros = new SelectList(p.Result, nameof(Parceiro.Nome), nameof(Parceiro.Nome), null); } var evento = Task.Run(() => _appServiceEvento.GetById(id)); await evento; Input = _mapper.Map <InputModelEvento>(evento.Result); }
private async Task OnLoad() { var sec = Task.Run(() => _appServiceSecretaria.List()); await sec; var parc = Task.Run(() => _appServiceParceiro.List()); await parc; Input = new InputModel() { Listar = parc.Result.ToList(), Ativo = true }; if (sec.Result != null) { Secretarias = new SelectList(sec.Result, nameof(Secretaria.Id), nameof(Secretaria.Nome), null); } }