Reputation: 4092
Take this example model:
public class Location
{
public string Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
public class Activity
{
public string Id { get; set; }
public string Name { get; set; }
public string Description { get; set; }
}
The relationship between these documents is a location can have none or many activities. Say London can have Paintball, Go karting etc.
I did thing to put these documents into one document but watching and reading the documentation and blogs, the documents need to be accessed separately. You can imagine a website page for each location listing activities and activity pages giving the details.
Example queries would be:
Using the DenormalizedReference method described at:
http://blogs.sonatribe.com/wayne/2011/07/06/using-denormalized-references-in-ravendb/
(and I did see this but couldn't figure out the syntax or if it does what I need
http://ravendb.net/faq/denormalized-references )
Seems to kind of fit my scenarios. But when making a demo project with the above types I noticed if I changed a location name it didn't change it in the activity. Keeping the documents in sync is a big thing.
So how do I achieve this?
Upvotes: 3
Views: 428
Reputation: 22956
Phil,
Upvotes: 2