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); }
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 Objeto MapperToEntity(ObjetoDTO objetoDTO) { Objeto objeto = new Objeto { Id = objetoDTO.Id, Peso = objetoDTO.Peso, Altura = objetoDTO.Altura, Largura = objetoDTO.Largura, Profundidade = objetoDTO.Profundidade }; return(objeto); }
public ObjetoDTO MapperToDTO(Objeto objeto) { ObjetoDTO objetoDTO = new ObjetoDTO { Id = objeto.Id, Peso = objeto.Peso, Altura = objeto.Altura, Largura = objeto.Largura, Profundidade = objeto.Profundidade }; return(objetoDTO); }
public IEnumerable <ObjetoDTO> MapperListClientes(IEnumerable <Objeto> objetos) { foreach (var o in objetos) { ObjetoDTO objetoDTO = new ObjetoDTO { Id = o.Id, Peso = o.Peso, Altura = o.Altura, Largura = o.Largura, Profundidade = o.Profundidade }; objetosDTO.Add(objetoDTO); } return(objetosDTO); }
public ActionResult Edit(ObjetoDTO objetoDTO) { try { try { _objetoServicoAplicacao.Atualizar(objetoDTO); } catch (Exception e) { throw e; } return(RedirectToAction(nameof(Index))); } catch { return(View()); } }
public void Excluir(ObjetoDTO obj) { var objeto = _mapperObjeto.MapperToEntity(obj); _objetoServicoDominio.Excluir(objeto); }
public void Atualizar(ObjetoDTO obj) { var objeto = _mapperObjeto.MapperToEntity(obj); _objetoServicoDominio.Atualizar(objeto); }
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)); }