2017-06-19 28 views
0

我有兩個實體MongoDbRef的自動加載在C#中的驅動程序

public class FileEntity 
{ 
    public ObjectId Id { get; set; } 

    [BsonElement("name")] 
    public string FileName { get; set; } 

    [BsonElement("tags")] 
    public List<MongoDBRef> Tags { get; set; } 
} 

public class TagEntity 
{ 
    public ObjectId Id { get; set; } 

    [BsonElement("tagId")] 
    public string TagId { get; set; } 

    [BsonElement("tagName")] 
    public string TagName { get; set; } 
} 

如何強制官方蒙戈C#驅動程序自動加載MongoDBRef引用物業FileEntity的「標籤」當我打電話find()方法?

+1

我不認爲這甚至是可能的。不過,你看過這個嗎? https://chrisbitting.com/2015/03/24/mongodb-linking-records-documents-using-mongodbref/ – dnickless

回答

0

它已被棄用的功能。您應該手動檢索參考數據。

相關問題