小编Ste*_*cia的帖子

RavenDB Transformer包括文档列表

我有点喜欢在RavenDB Transformer中使用include。说我有以下文档类:

public class Processor
{
    public string Id { get; set; }
    // other properties
}

public class Job
{
    public string Id { get; set; }
    public string ProcessorId { get; set; }
    // other properties
}
Run Code Online (Sandbox Code Playgroud)

她是我的观点模型:

public class ProcessorStatsViewModel
{
    public string Id { get; set; }
    public int JobCount { get; set; }
    // other properties
}
Run Code Online (Sandbox Code Playgroud)

在我的转换器中,我想查询处理器文档存储,并在作业存储中进行包含,以查找具有匹配处理器ID的每个作业。我发现的所有搜索结果都描述了当Processor类具有JobId列表时如何执行此操作。有没有办法在RavenDB中做到这一点?

我想要的变压器看起来像:

public Processors_StatsViewModel()
{
    TransformerResults = procs => 
        from p in procs
        let jobs = Include<Jobs>(p.Id) // …
Run Code Online (Sandbox Code Playgroud)

ravendb

5
推荐指数
1
解决办法
258
查看次数

标签 统计

ravendb ×1