public async Task <int> ImportStaticData(HashSet <string> staticNinList, IPregDataProvider staticdataSource, IPushPregData targetPusher) { var person = await staticdataSource.GetNextPerson(); while (staticdataSource.HasMore()) { if (staticNinList.Contains(person.NIN)) { if (person.NewNIN == "") { person.NewNIN = null; } if (person.OldNIN == "") { person.OldNIN = null; } targetPusher.AddToSaveQueue(new List <Person> { person }); var wasAdded = IdControl.TakenAdd(person.NIN); if (!wasAdded) { throw new Exception("TakenAdd feilet. dette skal ikke skje siden input liste er kun unike. Sjekk at database var tom initielt"); } staticNinList.Remove(person.NIN); } person = await staticdataSource.GetNextPerson(); } Outputter.WriteLine("Done importing static data. Number of object not found in source was " + staticNinList.Count + ". Items are put on save queue. Length:" + targetPusher.QueueLength()); return(staticNinList.Count); }
public void SetPusher(IPushPregData pusherPregData) { _pusherPregData = pusherPregData; }
public SynteticDataBuilderV1(SynteticModel model, IPushPregData pusherPregData, IdentifierDublicateControl idControl) { _pusherPregData = pusherPregData; _idControl = idControl; Model = model; }