Exemplo n.º 1
0
        public virtual string GetIndexById(Id id)
        {
            if (String.IsNullOrEmpty(id.Value))
            {
                throw new ArgumentNullException(nameof(id));
            }

            if (!ObjectId.TryParse(id.Value, out ObjectId objectId))
            {
                throw new ArgumentException("Unable to parse ObjectId", nameof(id));
            }

            return(TimeSeriesIndex.GetIndex(objectId.CreationTime));
        }
        public virtual string GetDocumentIndex(T document)
        {
            if (document == null)
            {
                throw new ArgumentNullException(nameof(document));
            }

            if (_getDocumentDateUtc == null)
            {
                throw new ArgumentException("Unable to get document index", nameof(document));
            }

            var date = _getDocumentDateUtc(document);

            return(TimeSeriesIndex.GetIndex(date));
        }