示例#1
0
        /// <summary>
        /// Create a new CrawlHistory object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="key">Initial value of the Key property.</param>
        /// <param name="groupId">Initial value of the GroupId property.</param>
        public static CrawlHistory CreateCrawlHistory(global::System.Int32 id, global::System.String key, global::System.Int32 groupId)
        {
            CrawlHistory crawlHistory = new CrawlHistory();

            crawlHistory.Id      = id;
            crawlHistory.Key     = key;
            crawlHistory.GroupId = groupId;
            return(crawlHistory);
        }
示例#2
0
        /// <summary>
        /// Register a unique key
        /// </summary>
        /// <param name="key">key to register</param>
        /// <returns>false if key has already been registered else true</returns>
        public bool Register(string key)
        {
            return(AspectF.Define.
                   WriteLock(m_CrawlHistoryLock).
                   Return <bool, NCrawlerEntitiesDbServices>(e =>
            {
                if (IsCrawled(key))
                {
                    return false;
                }

                e.AddToCrawlHistory(CrawlHistory.CreateCrawlHistory(0, key, m_GroupId));
                e.SaveChanges();
                return true;
            }));
        }
 /// <summary>
 /// Create a new CrawlHistory object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="key">Initial value of the Key property.</param>
 /// <param name="groupId">Initial value of the GroupId property.</param>
 public static CrawlHistory CreateCrawlHistory(global::System.Int32 id, global::System.String key, global::System.Int32 groupId)
 {
     CrawlHistory crawlHistory = new CrawlHistory();
     crawlHistory.Id = id;
     crawlHistory.Key = key;
     crawlHistory.GroupId = groupId;
     return crawlHistory;
 }
示例#4
0
 /// <summary>
 /// Deprecated Method for adding a new object to the CrawlHistory EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCrawlHistory(CrawlHistory crawlHistory)
 {
     base.AddObject("CrawlHistory", crawlHistory);
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the CrawlHistory EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToCrawlHistory(CrawlHistory crawlHistory)
 {
     base.AddObject("CrawlHistory", crawlHistory);
 }