I'm trying learn more about RavenDB and at the moment to focus on how to write good Indexes for RavenDB.

Let's say I have a object, Session, with an organization as a property and I want to group all sessions by the organization. And also I wan't the result to contain a list with all Sessions. How can I accomplish this?

public class Session {
    public string Organization { get; set; }
    ...
}

public class OrganizationSessions {
    public string OrganizationName { get; set; }
    public List<Session> Sessions { get; set; }
}

Any help is appreciated!

有帮助吗?

解决方案

Not the right question to ask.

Ask yourself what are you trying to do, and what model entities make the most sense to have. Then move from there.

Don't assume a class structure like you would have for a relational model.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top