2

I am trying to store / read dynamic content in MongoDB. I found a built in document type called BsonDocument to use it for such a purpose.

However, I don't want to return from my repository BsonDocument type since it has some dependecies to MongoDB libraries.

What's the best alternative for this requirements? Should I use a Dictionary<string, object> or my own record type?

Homam
  • 23,263
  • 32
  • 111
  • 187
  • 1
    Does [this](https://stackoverflow.com/questions/30421818/query-mongodb-collection-as-dynamic) help? – s7vr Jan 31 '18 at 15:00
  • @Veeram This helps but Find returns IFindFluent which is not IQueryable. I would like to return IQueryable to the business layer, not any MongoDB type – Homam Jan 31 '18 at 15:37
  • You can use `var cursor = database.GetCollection("foo").AsQueryable();` – s7vr Jan 31 '18 at 15:56

0 Answers0