public static async Task <DateTime> GetDateTimeAsync(this IBucketExtension bucket, string id, CancellationToken cancellationToken = default(CancellationToken))
        {
            var dateAsString = await bucket.GetStringAsync(id, cancellationToken);

            var dateTime = DateTime.Parse(dateAsString, System.Globalization.CultureInfo.CurrentCulture, System.Globalization.DateTimeStyles.RoundtripKind);

            return(dateTime);
        }
Example #2
0
        public async Task <bool> IsFirstInteractionAsync(Node from, CancellationToken cancellationToken)
        {
            var content = await _bucket.GetStringAsync(GetBucketKey(from, FirstInteraction), cancellationToken);

            return(string.IsNullOrWhiteSpace(content));
        }