コード例 #1
0
        protected override void OnStart(string[] args)
        {
            logger = new Logger();
            Thread loggerThread = new Thread(new ThreadStart(logger.Start));

            loggerThread.Start();
            var        personService = new PersonService(logger.con);
            var        personsInfo   = personService.personRepository.GetAll();
            XmlCreator persons       = new XmlCreator(logger.target);

            persons.XmlGenerate(personsInfo);
        }
コード例 #2
0
        protected override void OnStart(string[] args)
        {
            var           config  = new LibraryForFiles();
            List <Option> options = config.GetOptions();

            try
            {
                var personService = new PersonService(@"Data Source=ASUS;Initial Catalog=AdventureWorks2019;Integrated Security=True");
                var personsInfo   = personService.personRepository.GetAll();

                XmlCreator persons = new XmlCreator(options[0].Target);
                persons.XmlGenerate(personsInfo);
            }
            catch (Exception excep)
            {
                throw excep;
            }
        }