public void TestFixtureSetUp() { _store = NewDocumentStore(); IndexCreation.CreateIndexes(typeof(Player_Index_R03).Assembly, _store); var playerDictionary = DataGenerator.CreatePlayerList().ToDictionary(p => p.Id); var teamDictionary = DataGenerator.CreateTeamList().ToDictionary(p => p.Id); var employmentList = DataGenerator.CreateEmploymentList(); foreach (var employment in employmentList) { var team = teamDictionary[employment.TeamId]; employment.TeamName = team.Name; playerDictionary[employment.PlayerId].Employments.Add(employment); } using (var bulkInsert = _store.BulkInsert(null, new BulkInsertOptions { OverwriteExisting = true })) { foreach (var player in playerDictionary.Values) { bulkInsert.Store(player); } foreach (var team in teamDictionary.Values) { bulkInsert.Store(team); } } WaitForIndexing(_store); }
public void TestFixtureSetUp() { _store = NewDocumentStore(); IndexCreation.CreateIndexes(typeof(Player_Index_R03).Assembly, _store); var playerList = DataGenerator.CreatePlayerList(); var teamList = DataGenerator.CreateTeamList(); var employmentList = DataGenerator.CreateEmploymentList(); using (var bulkInsert = _store.BulkInsert(null, new BulkInsertOptions { OverwriteExisting = true })) { foreach (var player in playerList) { bulkInsert.Store(player); } foreach (var team in teamList) { bulkInsert.Store(team); } foreach (var employment in employmentList) { bulkInsert.Store(employment); } } WaitForIndexing(_store); }
public void TestFixtureSetUp() { _store = NewDocumentStore(); IndexCreation.CreateIndexes(typeof(Player).Assembly, _store); var players = DataGenerator.CreatePlayerList(); using (var bulkInsert = _store.BulkInsert()) { foreach (var player in players) { bulkInsert.Store(player); } } WaitForIndexing(_store); }
public void TestFixtureSetUp() { _store = NewDocumentStore(); var players = DataGenerator.CreatePlayerList(); using (var bulkInsert = _store.BulkInsert()) { foreach (var player in players) { bulkInsert.Store(player); } } // nasty: we have to initialize the dynamic index using (var session = _store.OpenSession()) { session.Query <Player>().Any(); } WaitForIndexing(_store); }