コード例 #1
0
        public async Task <IActionResult> _GetAgendamentoSalas()
        {
            try
            {
                IList <AgendaSalaViewModel> agendas = new List <AgendaSalaViewModel>();
                agendas = _mapper.Map <List <AgendaSalaViewModel> >(await _agendaSalaManager.GetAgendaSala());

                foreach (var agenda in agendas)
                {
                    agenda.salaModel = (await _salaManager.GetSalasBySalaId(agenda.SalaId));
                }

                TempData["AgendamentoSalas"] = agendas;
                //var agendamentos = JsonConvert.SerializeObject(agendas);
                return(PartialView(agendas));
            }
            catch (Exception ex)
            {
                TempData["NotifyMessage"] = "" + ex.Message;
                return(BadRequest());
            }
        }
コード例 #2
0
 public async Task <IActionResult> Get()
 {
     return(Ok(await _agendaSalaManager.GetAgendaSala()));
 }