public async Task <PackageEntry> findPackageByIdAsync(ObjectId id)
        {
            var found = await m_Packagecollection.FindAsync(HashExtentions.filterById(id)).Result.FirstOrDefaultAsync();

            if (found != null)
            {
                return(DatabaseExtentions <PackageEntryDb> .Deserialize(found));
            }
            return(null);
        }
Beispiel #2
0
        public async Task <BinaryVariationsDbEntry> findFileSystemByKey(string key)
        {
            var found = await m_BinaryVaryCollection.FindAsync(HashExtentions.filterByKey(key));

            if (found != null)
            {
                return(DatabaseExtentions <BinaryVariationsDbEntry> .Deserialize(found.FirstOrDefault()));
            }
            return(null);
        }
        public PackageEntry findPackageByFileName(string fileName)
        {
            var found = m_Packagecollection.FindAsync(HashExtentions.filterByFileName(fileName)).Result.FirstOrDefault();

            if (found != null)
            {
                return(DatabaseExtentions <PackageEntryDb> .Deserialize(found));
            }
            return(null);
        }
        public async Task<PackageEntry> GetPackageByHash(string hash) {

            var found = await m_Hashcollection.FindAsync(HashExtentions.filterByHash(hash)).Result.FirstOrDefaultAsync();
            if (found != null)
            {
                HashEntry he = DatabaseExtentions<HashEntry>.Deserialize(found);
                return await PackageDb.Instance.findPackageByIdAsync(he.PackageRef);
            }
            return null;
        }