public static T GetSampleContext <T>(this INode node, IGeofencingSample sample) where T : IGeofencingContext { if (sample.Cache != null) { var key = GeofencingKey.SharedPool.Get(); key.Id = node.Id; key.Who = sample.Who; try { if (sample.Cache.TryGetValue(key, out var context)) { return((T)context); } } finally { GeofencingKey.SharedPool.Return(key); } } return(default);
public static IEnumerable <IGeofencingEvent> Apply(this INode node, IGeofencingSample location) { return(Enumerable.Empty <IGeofencingEvent>()); }
public static IEnumerable <IGeofencingEvent> Apply(this IEnumerable <INode> nodes, IGeofencingSample location) => nodes.SelectMany(n => n.Apply(location));