static void Main(string[] args) { ServicePersona s = new ServicePersona(); Persona p = s.GetPersonaById("5d94b7953d0c303b88d41a71"); Console.WriteLine(p.Sexo.Descripcion); Console.WriteLine(p.Obra.Descripcion); Console.WriteLine(p.Factor.Descripcion); Console.ReadKey(); }
public IHttpActionResult Listado() { try { ServicePersona s = new ServicePersona(); return(Ok(s.GetAll())); } catch (Exception ex) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(ex.Message) }); } }
public IHttpActionResult Alta(PacienteDto paciente) { try { Persona p = PacienteDto.GetModelPersona(paciente); ServicePersona s = new ServicePersona(); s.AltaPersona(p, paciente.Genero, Convert.ToInt32(paciente.ObraSocial), Convert.ToInt32(paciente.FactorSanguineo), Convert.ToInt32(paciente.GrupoSanguineo)); return(Ok()); } catch (Exception ex) { throw new HttpResponseException(new HttpResponseMessage(HttpStatusCode.InternalServerError) { Content = new StringContent(ex.Message) }); } }