public virtual HttpResponseMessage GetEntity(int id) { var entity = _service.GetByID(id).Data; if (entity == null) { throw new HttpResponseException(Request.CreateResponse(HttpStatusCode.NotFound)); } return(Request.CreateResponse(HttpStatusCode.OK, _mapper.GetDTOForEntity <TEntity, TEntityDTO>(entity))); }
public void DTOMapperEntityToDTOTest() { Location location = new Location() { Name = "asdf", Address = "zxvc", LocationID = 1 }; var dto = mapper.GetDTOForEntity <Location, LocationDTO>(location); AssertLocationDTO(location, dto); }