Exemple #1
0
        internal bool TryGetCollectionContext(string collectionName, out IMongoDbCollectionContext collectionContext)
        {
            if (collectionName == null)
            {
                throw new ArgumentNullException(nameof(collectionName));
            }

            if (!collectionNames.TryGetValue(collectionName.ToLower(), out int index))
            {
                collectionContext = null;
                return(false);
            }

            collectionContext = collections[index];
            return(true);
        }
Exemple #2
0
        internal bool TryGetCollectionContext(Type documentType, out IMongoDbCollectionContext collectionContext)
        {
            if (documentType == null)
            {
                throw new ArgumentNullException(nameof(documentType));
            }

            if (!collectionDocumentTypes.TryGetValue(documentType, out int index))
            {
                collectionContext = null;
                return(false);
            }

            collectionContext = collections[index];
            return(true);
        }