Esempio n. 1
0
        public bool Exists(OmniHash rootHash)
        {
            lock (_lockObject)
            {
                var rootHashEntity = OmniHashEntity.Import(rootHash);

                var col = this.GetCollection();
                return(col.Exists(n => n.RootHash == rootHashEntity));
            }
        }
Esempio n. 2
0
        public void Delete(OmniHash rootHash)
        {
            lock (_lockObject)
            {
                var rootHashEntity = OmniHashEntity.Import(rootHash);

                var col = this.GetCollection();
                col.DeleteMany(n => n.RootHash == rootHashEntity);
            }
        }
        public SubscribedFileItem?FindOne(OmniHash rootHash, string registrant)
        {
            lock (_lockObject)
            {
                var rootHashEntity = OmniHashEntity.Import(rootHash);

                var col = this.GetCollection();
                return(col.FindOne(n => n.RootHash == rootHashEntity && n.Registrant == registrant)?.Export());
            }
        }
        public IEnumerable <SubscribedFileItem> Find(OmniHash rootHash)
        {
            lock (_lockObject)
            {
                var rootHashEntity = OmniHashEntity.Import(rootHash);

                var col = this.GetCollection();
                return(col.Find(n => n.RootHash == rootHashEntity).Select(n => n.Export()).ToArray());
            }
        }
Esempio n. 5
0
        public void Delete(OmniHash rootHash, string registrant)
        {
            lock (_lockObject)
            {
                var rootHashEntity = OmniHashEntity.Import(rootHash);

                var col = this.GetCollection();
                col.DeleteMany(n => n.RootHash == rootHashEntity && n.FilePath == null && n.Registrant == registrant);
            }
        }