Using Linq in MongoDb C# how to perform nested Join [closed]

有些话、适合烂在心里 提交于 2020-06-27 06:39:11

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!