public bool Exists(OmniHash rootHash) { lock (_lockObject) { var rootHashEntity = OmniHashEntity.Import(rootHash); var col = this.GetCollection(); return(col.Exists(n => n.RootHash == rootHashEntity)); } }
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()); } }
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); } }