1

I have the following POCOs in my service model:

public class Personnel {
 ...

    [Ignore]
    [Reference]
    public List<Posting> _Postings { get; set; }
}

public class Posting {
    ...

    [Reference]
    [Ignore]
    public Personnel Personnel { get; set; }

    [Reference]
    [Ignore]
    public Position _Position { get; set; }
}

public class Position {
    ...

    [Reference]
    [Ignore]
    public List<Posting> _Postings { get; set; }
}

When I use AutoQuery RDBMS to get Personnel I want to be able to get e.g. Personnel._Postings[1]._Position.Title.

How do I get the Position object which is a second level public property to Personnel using ServiceStack AutoQuery RDBMS? Please help.

4

1 回答 1

0

不要使用[Ignore]它来告诉OrmLiteAutoQuery忽略该属性。

AutoQuery自动返回嵌套结果,但您的数据模型需要遵循OrmLite 的参考约定

于 2019-03-21T17:30:29.273 回答