Ejemplo n.º 1
0
        // Returns the tour associated with a given bookmark id.
        public Tour GetBookmarkTour(Bookmark bookmark)
        {
            if (bookmark == null)
                return null;

            var bookmarkTour = Database.SqlQuery<Tour>("SELECT * FROM Tours WHERE Id in (SELECT Tour_Id FROM Bookmarks WHERE Id = {0})", bookmark.Id);
            return bookmarkTour.FirstOrDefault();
        }
Ejemplo n.º 2
0
        // Returns the tour associated with a given bookmark id.
        public Tour GetBookmarkTour(Bookmark bookmark)
        {
            if (bookmark == null)
                return null;

            IEnumerable<Tour> bookmarkTour = new Tour[0];
            try
            {
                retryPolicy.ExecuteAction(
                  () =>
                  {
                      bookmarkTour = Database.SqlQuery<Tour>("SELECT * FROM Tours WHERE Id in (SELECT Tour_Id FROM Bookmarks WHERE Id = {0})", bookmark.Id);
                  });
            }
            catch (Exception e)
            {
                throw e;
            }
            return bookmarkTour.FirstOrDefault();
        }