コード例 #1
0
        async Task ExecuteLoadItemsCommand()
        {
            if (IsBusy)
            {
                return;
            }

            IsBusy = true;

            try
            {
                Items.Clear();
                var items = await _EventoNegocio.GetEventosEmAltaAsync();

                foreach (var item in items)
                {
                    Items.Add(item);
                }
            }
            catch (Exception ex)
            {
                Debug.WriteLine(ex);
                MessagingCenter.Send <string>("Não foi possivel Comunicar com o servidor", HelperMessagingCenter.FalhaComunicacao);
            }
            finally
            {
                IsBusy = false;
            }
        }
コード例 #2
0
        public async Task <ActionResult> GetEventosEmAltaAsync()
        {
            var eventos = await _eventoNegocio.GetEventosEmAltaAsync();

            if (eventos == null)
            {
                return(NotFound(new { message = "Eventos não encontrados" }));
            }

            return(Ok(eventos));
        }