public int Import(string filePath, int ownerId) { //Create GEDCOM Store var treeName = Path.GetFileNameWithoutExtension(filePath); var store = new GEDCOMStore(filePath); var treeService = _serviceFactory.CreateTreeService(); var tree = new Tree() { Name = treeName, OwnerId = ownerId}; treeService.Add(tree); _repositoryLookup = new Dictionary<int, int>(); //Add Repositories ProcessRepositories(store.Repositories, tree.TreeId); _sourceLookup = new Dictionary<int, int>(); //Add Sources ProcessSources(store.Sources, tree.TreeId); _individualLookup = new Dictionary<int, int>(); //Add Individuals ProcessIndividuals(store.Individuals, tree.TreeId); //Add Families ProcessFamilies(store.Families, tree.TreeId); return tree.TreeId; }
public int Import(string filePath, int ownerId) { //Create GEDCOM Store var treeName = Path.GetFileNameWithoutExtension(filePath); var store = new GEDCOMStore(filePath); var treeService = _serviceFactory.CreateTreeService(); var tree = new Tree() { Name = treeName, OwnerId = ownerId }; treeService.Add(tree); _repositoryLookup = new Dictionary <int, int>(); //Add Repositories ProcessRepositories(store.Repositories, tree.TreeId); _sourceLookup = new Dictionary <int, int>(); //Add Sources ProcessSources(store.Sources, tree.TreeId); _individualLookup = new Dictionary <int, int>(); //Add Individuals ProcessIndividuals(store.Individuals, tree.TreeId); //Add Families ProcessFamilies(store.Families, tree.TreeId); return(tree.TreeId); }