async public void SaveToDatabase(Initialization ini, HistoryDemo.Entities.Configuration conf) { string fileName = $"datalog\\{DateTime.Now:yyyy-MM-dd-HH-mm-ss}.mat"; await Task.Run(() => { Console.WriteLine(Thread.CurrentThread.ManagedThreadId); SaveToFile(fileName); DataManipulation.Create(ini, conf, fileName); }); }