public void CreateNewIndexAndMappingForNestedListOfChild() { var mappingTestsParent = new MappingTestsParentWithList { Calls = 3, MappingTestsParentId = 3, MappingTestsItemList = new List <MappingTestsChild> { new MappingTestsChild { Description = "Hello nested", MappingTestsChildId = 6 }, new MappingTestsChild { Description = "Hello nested item in list", MappingTestsChildId = 7 } } }; using ( var context = new ElasticsearchContext(ConnectionString, new ElasticsearchSerializerConfiguration(_elasticsearchMappingResolver))) { context.TraceProvider = new ConsoleTraceProvider(); context.AddUpdateDocument(mappingTestsParent, mappingTestsParent.MappingTestsParentId); context.SaveChangesAndInitMappings(); Thread.Sleep(1500); var doc = context.GetDocument <MappingTestsParentWithList>(mappingTestsParent.MappingTestsParentId); Assert.NotNull(doc); } }
public void CreateNewIndexAndMappingForNestedListOfChild() { var mappingTestsParent = new MappingTestsParentWithList { Calls = 3, MappingTestsParentId = 3, MappingTestsItemList = new List<MappingTestsChild> { new MappingTestsChild { Description = "Hello nested", MappingTestsChildId = 6 }, new MappingTestsChild { Description = "Hello nested item in list", MappingTestsChildId = 7 } } }; using ( var context = new ElasticsearchContext(ConnectionString, new ElasticsearchSerializerConfiguration(_elasticsearchMappingResolver))) { context.TraceProvider = new ConsoleTraceProvider(); context.AddUpdateDocument(mappingTestsParent, mappingTestsParent.MappingTestsParentId); context.SaveChangesAndInitMappings(); Thread.Sleep(1500); var doc = context.GetDocument<MappingTestsParentWithList>(mappingTestsParent.MappingTestsParentId); Assert.IsNotNull(doc); } }