Beispiel #1
0
 /// <CheckFeedExists>
 /// Check the Feed is Exists.
 /// </summary>
 /// <param name="FeedsUrl">Url of feed.(String)</param>
 /// <param name="Message">Message of feedReader.(String)</param>
 /// <param name="PublishedDate">Date and time of publishing.(String)</param>
 /// <returns>True or False.(bool)</returns>
 public bool CheckFeedExists(string FeedsUrl, string Message, string PublishedDate)
 {
     //Creates a database connection and opens up a session
     using (NHibernate.ISession session = SessionFactory.GetNewSession())
     {
         //After Session creation, start Transaction.
         using (NHibernate.ITransaction transaction = session.BeginTransaction())
         {
             try
             {
                 NHibernate.IQuery query = session.CreateQuery("from RssReader where FeedsUrl =:feedurl and Description =:desc and PublishedDate=:published");
                 query.SetParameter("feedurl", FeedsUrl);
                 query.SetParameter("desc", Message);
                 query.SetParameter("published", PublishedDate);
                 RssFeeds rss = query.UniqueResult <RssFeeds>();
                 if (rss == null)
                 {
                     return(false);
                 }
                 else
                 {
                     return(true);
                 }
             }
             catch (Exception ex)
             {
                 Console.WriteLine(ex.StackTrace);
                 return(true);
             }
         } //End Transaction
     }     //End Session
 }
Beispiel #2
0
 public void UpdateRss(RssFeeds rss)
 {
     throw new NotImplementedException();
 }