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 }); } }
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 })); }
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)");