Search code examples
mongodbmongodb-.net-drivermongorepository

Namespace reference to get DBRef in MongoDB C# driver


I'm using the MongoDB C# driver and I would like to do things similar to https://stackoverflow.com/a/15248058/106866.

So I created an entity like this:

using System.Collections.Generic;
using MongoDB.Driver;
using MongoRepository;
using MongoDB.Bson;
using MongoDB;

...

public class Movie : Entity {
    public string Title { get; set; }
    public string Synopsis { get; set; }
    public List<DBRef> Likes { get; set; }
}

But the DBRef gives the following error:

The type or namespace 'DBRef' could not be found.

I am using version 1.8.1.20 of the driver and version 1.5.1.0 of MongoRepository.

What namespace do I have to reference to get DBRef?


Solution

  • Seems that the type in the linked question is wrong and should actually be MongoDBRef