示例#1
0
        public void Update(SystemEntity entity)
        {
            if (!_universalSearchItemGenerator.CanGenerate(entity))
            {
                return;
            }
            var data = new UniversalSearchIndexData
            {
                Action = UniversalSearchIndexAction.Update,
                UniversalSearchItem = _universalSearchItemGenerator.GenerateItem(entity)
            };

            if (!AnyExistInEndRequest(data))
            {
                CurrentRequestData.OnEndRequest.Add(new AddUniversalSearchTaskInfo(data));
            }
        }
示例#2
0
 public UniversalSearchIndexDataComparison(UniversalSearchIndexData data)
 {
     _guid   = data.UniversalSearchItem.SearchGuid;
     _action = data.Action;
 }
示例#3
0
 private static bool AnyExistInEndRequest(UniversalSearchIndexData data)
 {
     return
         (CurrentRequestData.OnEndRequest.OfType <AddUniversalSearchTaskInfo>()
          .Any(task => UniversalSearchIndexData.Comparer.Equals(data, task.Data)));
 }
示例#4
0
 public override void SetData(string data)
 {
     UniversalSearchIndexData = JsonConvert.DeserializeObject <UniversalSearchIndexData>(data);
 }