private void FillOrientationIfItIsNecessary(ReviewTransport transport) { ReviewTransportBranch branch = transport.ReviewTransportBranch; ReviewTransportBranchOrientation orientation = branch.ReviewTransportBranchOrientation; if (String.IsNullOrEmpty(orientation.Description)) { TransportBranchOrientation existingOrientation = this._transportService.GetTransportBranchOrientationById(transport.TransportId, branch.BranchId, orientation.OrientationId); orientation.Description = existingOrientation.Description; } }
public TransportBranchOrientation GetTransportBranchOrientationById(int transportId, int branchId, int orientationId) { TransportBranch branch = this.GetTransportBranchById(transportId, branchId); TransportBranchOrientation orientation = branch.Orientations.FirstOrDefault(x => x.OrientationId == orientationId); if (orientation == null) { throw new ObjectNotFoundException(); } return(orientation); }