问题
Giving these classes in C#
Inbox.cs
public class Inbox : TDocument
{
public string Name {get;set;}
public List<MongoDBRef> WorkOrdersRef {get;set;}
public List<InboxRule> Rules {get;set;}
[BsonIgnore] public List<WorkOrder> WorkOrders {get;set;}
}
InboxRule.cs
public InboxRule : TDocument
{
public MongoDBRef ServiceRef {get;set;}
public MongoDBRef WorkOrderStatusRef {get;set;}
[BsonIgnore] public Service Service {get;set;}
[BsonIgnore] public WorkOrderStatus WorkOrderStatus {get;set;}
}
How to populate the [BsonIgnore]
-properties for an Inbox
object and it's embedded document property known as Rules
?
Note*: MongoDBRef is a class holding Collection Name
and ID
for another document
来源:https://stackoverflow.com/questions/62296658/using-linq-in-mongodb-c-sharp-how-to-perform-nested-join