2

I have class

class UserActivity
{
    private IList<Activity> _activities = new List<Activity>();

    public void AddActivity(Activity activity)
    {
        _activities.Add(activity);
    }

    public IEnumerable<Activity> ActivityHistory
    {
        return _activities;
    }
}

Activity history can have a lot of elements.

I wish store UserActivity in RavenDB with history. But, when I get UserActivity first time from DB, ActivityHistory should have last 10 items, for example, and I should have possibility load other items or add new to collection and save them.

How I can do it?

As I understand, i have only one way - store apart UserActivity and history items.

Gengzu
  • 542
  • 1
  • 4
  • 13

1 Answers1

1

Gengzu, Yes, you need to deal with the document as a whole. You can project parts of the documents out into an index, but that is a projection, not an entity

Ayende Rahien
  • 22,925
  • 1
  • 36
  • 41
  • Yes, I know what I can do. But I wish know what i should do in this case) Some recomends, best practice or any thing else. Thanks in advance. – Gengzu May 16 '11 at 20:43