Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating multiple entities inside one document
    text
    copied!<p>Newbie, working with MVC and Document database. I have a Movies class</p> <pre><code>public class Movie { public string Id { get; set; } public string MovieName { get; set; } public DateTime ReleaseDate{ get; set; } public int NumOfShows { get; set; } } </code></pre> <p>Right now I am creating documents in Raven DB, one for each movie. It looks like something like this. It gets updated from a MVC page. I am successfully able to do this now from MVC app to Raven.</p> <pre><code>{ "MovieName": "Wild wild west", "ReleaseDate": "12th Dec", "NumOfShows ": "5" } </code></pre> <p>But this is not what my goal is. .. My objective is to create one document for one movieTheater with multiple movie informations in it. Something that looks like this...</p> <pre><code> { "TheaterId": "Hd45", "TheaterName" : "Blvd", { "MovieName": "Wild wild west", "ReleaseDate": "12th Dec", "NumOfShows ": "5" } { "MovieName": "Shrek", "ReleaseDate": "12th Dec", "NumOfShows ": "5" } { "MovieName": "Ronin", "ReleaseDate": "12th Dec", "NumOfShows ": "5" } } </code></pre> <p>How can I do this..Any help is greatly appreciated. Detailed explanation would be really helpful for my understanding.</p> <p><strong>Update:</strong></p> <pre><code>[HttpPost] public ActionResult Create(TheaterViewModel input) { var Theater = new Theater { TheaterId = input.Theater.TheaterId, TheaterName = input.Theater.TheaterName, // How do I get the Movies nested here, I mean updated }; _repository.Add(Theater); _repository.Save(); } </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload