Exemple #1
0
        public async void myFirstMethod()
        {
            Console.WriteLine("Testing");
            //Task.Run(() => _anotherService.callMe());

            Thread thread = new Thread(delegate()
            {
                var options = new DbContextOptionsBuilder <Repository.Repository.BloggingContext>();
                options.UseSqlite("Data Source=caraii_borracha.db");

                using (var db = new Repository.Repository.BloggingContext(options.Options))
                {
                    AnotherService another = new AnotherService(db);
                    another.callMe();
                }
            });

            thread.Start();
            thread.Join();

            Console.WriteLine("Terminou o trem");
        }
Exemple #2
0
 public AnotherService(Repository.Repository.BloggingContext context)
 {
     _context = context;
 }