Esempio n. 1
0
 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));
     }
 }
Esempio n. 2
0
        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);
        }
Esempio n. 3
0
        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));
        }
Esempio n. 5
0
 public ActionResult Get()
 {
     return(Ok(
                pacienteService.GetAll()
                ));
 }
Esempio n. 6
0
 // GET: Pais
 public IActionResult Index()
 {
     return(View(_pacienteService.GetAll()));
 }
Esempio n. 7
0
 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()
                ));
 }
Esempio n. 10
0
 public ActionResult <IEnumerable <Paciente> > Get()
 {
     _logger.LogInformation("Obteniendo los Pacientes");
     return(Ok(_service.GetAll()));
 }