protected IDictionary <string, BsonDocument> CreateAndGetIndexes <TDocument>(bool doDrop = true) { var collectionName = typeof(TDocument).GetTypeInfo().GetCollectionName(); if (doDrop) { GetDb().DropCollection(collectionName); GetDb().CreateCollection(collectionName); } manager.EnsureIndexes( GetDb(), typeof(TDocument) ); return(GetIndexes <TDocument>(collectionName)); }