public PlaneDetails GetDetails(int id) { var plane = GetById(id); var planeType = _planeTypeService.GetById(plane.PlaneTypeId); return(PlaneDetails.Create(plane, planeType)); }
public IList <PlaneDetails> GetAllDetails() { var planes = GetAll(); var planeTypes = _planeTypeService.GetAll(); var joined = from plane in planes join planeType in planeTypes on plane.PlaneTypeId equals planeType.Id select PlaneDetails.Create(plane, planeType); return(joined.ToList());; }
public PlaneDetails GetDetails(int id) { var plane = _unitOfWork.Set <Plane>() .Details(x => x.Id == id).FirstOrDefault(); if (plane == null) { throw new NotFoundException("Plane with such id was not found"); } return(PlaneDetails.Create(plane)); }