예제 #1
0
 public static bool AnyIndexes(object obj, LuceneOperation operation)
 {
     if (obj == null)
     {
         return(false);
     }
     return
         (IndexDefinitionTypes.Any(
              definition => definition.GetUpdateTypes(operation).Any(type => type.IsAssignableFrom(obj.GetType()))));
 }
예제 #2
0
 public List<LuceneAction> GetAllActions(object entity, LuceneOperation operation)
 {
     if (!(entity is SystemEntity))
         return new List<LuceneAction>();
     var systemEntity = entity as SystemEntity;
     var actionsDictionary = GetActionsDictionary(operation);
     var luceneActions = new List<LuceneAction>();
     foreach (var action in actionsDictionary.Keys.SelectMany(key => actionsDictionary[key]))
     {
         luceneActions.AddRange(action(systemEntity));
     }
     return luceneActions;
 }
예제 #3
0
        public List <LuceneAction> GetAllActions(object entity, LuceneOperation operation)
        {
            if (!(entity is SystemEntity))
            {
                return(new List <LuceneAction>());
            }
            var systemEntity      = entity as SystemEntity;
            var actionsDictionary = GetActionsDictionary(operation);
            var luceneActions     = new List <LuceneAction>();

            foreach (var action in actionsDictionary.Keys.SelectMany(key => actionsDictionary[key]))
            {
                luceneActions.AddRange(action(systemEntity));
            }
            return(luceneActions);
        }
예제 #4
0
        public List <LuceneAction> GetAllActions(object entity, LuceneOperation operation)
        {
            if (!(entity is SystemEntity))
            {
                return(new List <LuceneAction>());
            }
            SystemEntity systemEntity = entity as SystemEntity;
            Dictionary <Type, List <Func <SystemEntity, IEnumerable <LuceneAction> > > > actionsDictionary = GetActionsDictionary(operation);
            List <LuceneAction> luceneActions = new List <LuceneAction>();

            foreach (Func <SystemEntity, IEnumerable <LuceneAction> > action in actionsDictionary.Keys.SelectMany(key => actionsDictionary[key]))
            {
                luceneActions.AddRange(action(systemEntity));
            }
            return(luceneActions);
        }
예제 #5
0
        public static void QueueTask(Type type, SiteEntity siteEntity, LuceneOperation operation)
        {
            if (IndexingHelper.AnyIndexes(siteEntity, operation))
            {
                var info = new QueuedTaskInfo
                {
                    Data   = siteEntity.Id.ToString(),
                    Type   = type.MakeGenericType(siteEntity.GetType()),
                    SiteId = siteEntity.Site.Id
                };

                if (!CurrentRequestData.OnEndRequest.OfType <AddLuceneTaskInfo>().Any(task => info.Equals(task.Data)))
                {
                    CurrentRequestData.OnEndRequest.Add(new AddLuceneTaskInfo(info));
                }
            }
        }
예제 #6
0
 public abstract Dictionary <Type, List <Func <SystemEntity, IEnumerable <LuceneAction> > > > GetActionsDictionary(
     LuceneOperation operation);
예제 #7
0
 public abstract IEnumerable <Type> GetUpdateTypes(LuceneOperation operation);
예제 #8
0
 public abstract Dictionary<Type, List<Func<SystemEntity, IEnumerable<LuceneAction>>>> GetActionsDictionary(
     LuceneOperation operation);
예제 #9
0
 public abstract IEnumerable<Type> GetUpdateTypes(LuceneOperation operation);