public IActionResult Get() { try { return(Ok(_pacienteService.GetAll().Select(s => s.ToPacienteViewModel()).ToArray())); } catch (AppException ex) { return(SendFeedback(ex.Message)); } catch (System.Exception ex) { _logger.LogError(ex.Message, ex, ex.InnerException); return(SendFeedback(_unavailable)); } }
public void Paciente_Get_All() { //Arrange // _mockRepository.Setup(x => x.GetAll()).Returns(listCountry); // var _mock = new Mock<IGenericRepository<Paciente>>(); var listado = FakeListadoPacientes(); //_mockUnitWork.Setup(x=>x.Repository= ) _ = _mockRepository.Setup(x => x.GetAll(null, null, null, null)).Returns(listado.ToList()); //Act _service = new PacienteService(_mockUnitWork.Object, _mockRepository.Object); var results = _service.GetAll().ToList(); //Assert Assert.Equal(listado, results); Assert.Equal(4, results.Count); }
public override void OnNavigatedTo(NavigationParameters parameters) { IsBusy = true; switch (parameters.GetNavigationMode()) { case NavigationMode.Back: if (parameters.ContainsKey("pacienteItem")) { Paciente paciente = parameters.GetValue <Paciente>("pacienteItem"); if (_pacienteService.SaveOrUpdate(paciente) > 0) { Pacientes.Add(paciente); } } break; case NavigationMode.New: //Medicos.AddRange(parameters.GetValues<string>("medico").Select(n => new Medico { Nome = n })); Pacientes.AddRange(_pacienteService.GetAll()); break; } IsBusy = false; }
public async Task <IActionResult> Get() { var pacientes = _pacienteService.GetAll(); return(Ok(pacientes)); }
public ActionResult Get() { return(Ok( pacienteService.GetAll() )); }
// GET: Pais public IActionResult Index() { return(View(_pacienteService.GetAll())); }
public IEnumerable <ListagemViewModel> GetAll() { return(Mapper.Map <IEnumerable <Paciente>, IEnumerable <ListagemViewModel> >(_pacienteService.GetAll())); }
public IEnumerable <PacienteDTO> GetPacientes() { return(pacienteService.GetAll()); }
public IActionResult Get() { return(Json( _PacienteService.GetAll() )); }
public ActionResult <IEnumerable <Paciente> > Get() { _logger.LogInformation("Obteniendo los Pacientes"); return(Ok(_service.GetAll())); }