BB.Caching.Redis.Analytics.BitwiseAnalytics.HasEvent C# (CSharp) Méthode

HasEvent() public static méthode

Determines if an event occured.
public static HasEvent ( string category, string action, long eventId, System.DateTime start = default(DateTime), System.DateTime end = default(DateTime) ) : bool
category string /// Typically the object that was interacted with (e.g. button) ///
action string /// The type of interaction (e.g. click) ///
eventId long /// The id of the thing being interacted with. ///
start System.DateTime /// The start of the period we're interested in, defaulting to now. ///
end System.DateTime /// The end of the period we're interested in, defaulting to now. ///
Résultat bool
        public static bool HasEvent(
            string category,
            string action,
            long eventId,
            DateTime start = default(DateTime),
            DateTime end = default(DateTime))
        {
            if (start == default(DateTime))
            {
                start = DateTime.UtcNow;
            }

            if (end == default(DateTime) || start == end)
            {
                end = start.AddMinutes(1);
            }

            return Count(
                SharedCache.Instance.GetAnalyticsWriteConnection().GetDatabase(SharedCache.Instance.Db),
                Ops.Or(new Event(category, action, start, end, TimeInterval.FifteenMinutes))) > 0;
        }