public BoardingModel GetBoardingById(BoardingId boardingId) { BoardingModel model = new BoardingModel(); using (ISession session = NHibernateSession.OpenSession()) // Open a session to conect to the database { var dbItem = session.Query <Boarding>().FirstOrDefault(c => c.BoardingId == boardingId.Value); if (dbItem != null) { model = dbItem.ToBoardingModel(); } } return(model); }
public BoardingModel GetBoardingById(BoardingId boardingId) { return(_boardingRepository.GetBoardingById(boardingId)); }