public Guid Id { get; set; }
public List<UserApplication> Applications { get; set; }
public string UserName { get; set; }
public class UserApplication
public Guid ApplicationId { get; set; }
public Guid Id { get; set; }
public string Name { get; set; }
public Uri Realm { get; set; }
And here's the very not compiling sad attempt at writing the index:
public class UserAppLinkIndex : AbstractIndexCreationTask<User>
{
public UserAppLinkIndex()
{
Map = users => users.Select(
u => new
{
u.UserName,
AppIds = u.Applications.Select(a => a.ApplicationId)
});
TransformResults = (db, users) => users
.SelectMany(u => u.AppIds, id => db.Load<Application>(id))
.Select(a => new
{
a.Name,
a.Realm
});
}
}
What I'm attempting to do is get all the App Ids for a user, then join to the Application document to get all the Names and Realms for the user. I'm struggling to understand which steps of the index are responsible for doing what, and what shape the data is in during each of those steps. Help?