コード例 #1
0
        public void Delete(string id)
        {
            var reviewData = _store.Items <Review>().Where(data => data.MovieId == id)
                             .ToList();

            foreach (var item in reviewData)
            {
                _store.Delete(item.Id);
            }
        }
コード例 #2
0
        public void UnignoreRedirect(string oldUrl, int siteId)
        {
            // Get hold of the datastore
            DynamicDataStore store = DataStoreFactory.GetStore(typeof(CustomRedirect));

            //find object with matching property "OldUrl"
            var urlEncode = HttpUtility.UrlEncode(oldUrl);

            if (urlEncode != null)
            {
                var savedUrl = urlEncode.ToLower().Replace("%2f", "/");
                var filters  = new Dictionary <string, object>
                {
                    { OldUrlPropertyName, savedUrl.ToLower() },
                    { SiteIdPropertyName, siteId }
                };
                CustomRedirect match = store.Find <CustomRedirect>(filters).SingleOrDefault();
                if (match != null)
                {
                    // log request to database - if logging is turned on.
                    if (Configuration.Configuration.Logging == LoggerMode.On)
                    {
                        store.Delete(match);
                        // Safe logging
                        RequestLogger.Instance.LogRequest(savedUrl, string.Empty, siteId);
                    }
                }
            }
        }
コード例 #3
0
        public static void RemovePersistedValuesFor(this DynamicDataStore store, string pluginId)
        {
            var existingBags = store.FindAsPropertyBag("PluginId", pluginId);

            foreach (var existingBag in existingBags)
            {
                store.Delete(existingBag);
            }
        }
コード例 #4
0
        public void Delete(ISyncKeyMap syncKeyMap)
        {
            var ddsSyncKeyMap = syncKeyMap as DdsSyncKeyMap;

            if (ddsSyncKeyMap != null)
            {
                _store.Delete(ddsSyncKeyMap.Id);
            }
        }
コード例 #5
0
        /// <summary>
        /// Delete all CustomRedirect objects
        /// </summary>
        public void DeleteAllCustomRedirects()
        {
            // In order to avoid a database timeout, we delete the items one by one.
            DynamicDataStore store = DataStoreFactory.GetStore(typeof(CustomRedirect));

            foreach (CustomRedirect redirect in GetCustomRedirects(false))
            {
                store.Delete(redirect);
            }
        }
コード例 #6
0
ファイル: SearchFactory.cs プロジェクト: hwebz/NTCWeb
 internal static void RemoveProcessedQueueItems(System.Collections.ObjectModel.Collection <Identity> ids)
 {
     using (DynamicDataStore dynamicDataStore = SearchSettings.GetDynamicDataStore())
     {
         foreach (Identity current in ids)
         {
             dynamicDataStore.Delete(current);
         }
     }
 }
コード例 #7
0
        public int DeleteAllIgnoredRedirects()
        {
            // In order to avoid a database timeout, we delete the items one by one.
            DynamicDataStore store = DataStoreFactory.GetStore(typeof(CustomRedirect));
            var ignoredRedirects   = GetIgnoredRedirect();

            foreach (CustomRedirect redirect in ignoredRedirects)
            {
                store.Delete(redirect);
            }
            return(ignoredRedirects.Count());
        }
コード例 #8
0
        /// <summary>
        /// Delete CustomObject object from Data Store that has given "OldUrl" property
        /// </summary>
        /// <param name="currentCustomRedirect"></param>
        public void DeleteCustomRedirect(string oldUrl)
        {
            // Get hold of the datastore
            DynamicDataStore store = DataStoreFactory.GetStore(typeof(CustomRedirect));

            //find object with matching property "OldUrl"
            CustomRedirect match = store.Find <CustomRedirect>(OLD_URL_PROPERTY_NAME, oldUrl.ToLower()).SingleOrDefault();

            if (match != null)
            {
                store.Delete(match);
            }
        }
コード例 #9
0
        public void Delete(int id)
        {
            var item = _store.Items <Rate>().FirstOrDefault(x => x.Id.StoreId == id);

            if (item != null)
            {
                try
                {
                    _store.Delete(item.Id);
                }
                catch (Exception e)
                {
                    Log.Error(e.Message);
                }
            }
        }
コード例 #10
0
        /// <summary>
        /// Delete CustomObject object from Data Store that has given "OldUrl" property
        /// </summary>
        /// <param name="oldUrl"></param>
        /// <param name="siteId"></param>
        public void DeleteCustomRedirect(string oldUrl, int siteId)
        {
            // Get hold of the datastore
            DynamicDataStore store = DataStoreFactory.GetStore(typeof(CustomRedirect));

            //find object with matching property "OldUrl"
            var urlEncode = HttpUtility.UrlEncode(oldUrl);

            if (urlEncode != null)
            {
                var savedUrl = urlEncode.ToLower().Replace("%2f", "/");
                var filters  = new Dictionary <string, object>
                {
                    { OldUrlPropertyName, savedUrl.ToLower() },
                    { SiteIdPropertyName, siteId }
                };
                CustomRedirect match = store.Find <CustomRedirect>(filters).SingleOrDefault();
                if (match != null)
                {
                    store.Delete(match);
                }
            }
        }
コード例 #11
0
 public void Remove(Identity identity)
 {
     _store.Delete(identity);
 }
コード例 #12
0
        public void Delete(ISyncState syncState)
        {
            var ddsSyncState = syncState as DdsSyncState;

            _store.Delete(ddsSyncState.Id);
        }
コード例 #13
0
 public void Delete(Guid commentId)
 {
     _commentStore.Delete(commentId);
 }