Example #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);
            }
        }
Example #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);
                    }
                }
            }
        }
Example #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);
            }
        }
Example #4
0
        public void Delete(ISyncKeyMap syncKeyMap)
        {
            var ddsSyncKeyMap = syncKeyMap as DdsSyncKeyMap;

            if (ddsSyncKeyMap != null)
            {
                _store.Delete(ddsSyncKeyMap.Id);
            }
        }
Example #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);
            }
        }
Example #6
0
 internal static void RemoveProcessedQueueItems(System.Collections.ObjectModel.Collection <Identity> ids)
 {
     using (DynamicDataStore dynamicDataStore = SearchSettings.GetDynamicDataStore())
     {
         foreach (Identity current in ids)
         {
             dynamicDataStore.Delete(current);
         }
     }
 }
Example #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());
        }
Example #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);
            }
        }
        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);
                }
            }
        }
Example #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);
                }
            }
        }
Example #11
0
 public void Remove(Identity identity)
 {
     _store.Delete(identity);
 }
Example #12
0
        public void Delete(ISyncState syncState)
        {
            var ddsSyncState = syncState as DdsSyncState;

            _store.Delete(ddsSyncState.Id);
        }
Example #13
0
 public void Delete(Guid commentId)
 {
     _commentStore.Delete(commentId);
 }