Example #1
0
        public static ObjetoDTO TransformarEntityEnDTO(ObjetoEntity entity, int atribPes)
        {
            ObjetoDTO dto = new ObjetoDTO();

            dto.Nombres         = MapperEstructurasUtilidades.CrearCadenaDTO(entity.Nombres, atribPes, null);
            dto.Apellidos       = MapperEstructurasUtilidades.CrearCadenaDTO(entity.Apellidos, atribPes, null);
            dto.Rut             = MapperEstructurasUtilidades.CrearEnteroDTO(entity.Rut, atribPes, null);
            dto.FechaNacimiento = MapperEstructurasUtilidades.CrearFechaDTO(entity.FechaNacimiento, atribPes, null);
            return(dto);
        }
Example #2
0
        public static ObjetoEntity TransformarDTOEnEntity(ObjetoDTO dto)
        {
            ObjetoEntity entity = new ObjetoEntity();

            entity.Nombres         = MapperEstructurasUtilidades.ExtraerCadena(dto.Nombres);
            entity.Apellidos       = MapperEstructurasUtilidades.ExtraerCadena(dto.Apellidos);
            entity.Rut             = MapperEstructurasUtilidades.ExtraerEntero(dto.Rut);
            entity.FechaNacimiento = MapperEstructurasUtilidades.ExtraerFecha(dto.FechaNacimiento);
            return(entity);
        }
        public IHttpActionResult CaptureEntityToDTO(ObjetoEntity test)
        {
            ObjetoDTO dto = MapperUtilidades.TransformarEntityEnDTO(test, 0);

            return(Ok(dto));
        }
        public IHttpActionResult CaptureDTOToEntity(ObjetoDTO test)
        {
            ObjetoEntity entity = MapperUtilidades.TransformarDTOEnEntity(test);

            return(Ok(entity));
        }