示例#1
0
        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);
        }
示例#2
0
 public BoardingModel GetBoardingById(BoardingId boardingId)
 {
     return(_boardingRepository.GetBoardingById(boardingId));
 }