Exemple #1
0
 public static void ParseSourceDest(this XElement element, SourceDestinationType type, IList <SourceDestination> list)
 {
     foreach (var child in element.Elements(type.DisplayName))
     {
         list.Add(new SourceDestination
         {
             Type      = child.Attribute("type").Value,
             Id        = child.Value,
             Direction = type
         });
     }
 }
Exemple #2
0
        private void ParseSourceDest(EpcisEvent epcisEvent, SourceDestinationType direction, IList <JToken> dictionary)
        {
            if (dictionary == null || !dictionary.Any())
            {
                return;
            }

            dictionary.Select(x => x.ToObject <IDictionary <string, JObject> >()).ForEach(values => epcisEvent.SourceDestinationList.Add(new SourceDestination
            {
                Type      = values["type"].ToString(),
                Id        = values[direction.DisplayName].ToString(),
                Direction = direction
            }));
        }
Exemple #3
0
 public void WhereSourceDestinationValueIn(string sourceName, SourceDestinationType type, string[] sourceValues)
 => _query = _query.Where($"EXISTS(SELECT sd.event_id FROM epcis.source_destination sd WHERE sd.direction = {type.Id} AND sd.type = {_parameters.Add(sourceName)} AND sd.source_dest_id = ANY({_parameters.Add(sourceValues)}) AND sd.event_id = event.id)");