public async static Task Main() { // Coz greek mythology is gut Lacedaimon lacedaimon = await Lacedaimon.LacedaimonFactoryAsync(); // Constructor cannot be async, so I use factory instead lacedaimon.ProcessFiles(); }
public static async Task <Lacedaimon> LacedaimonFactoryAsync() { Lacedaimon lacedaimon = new Lacedaimon() { ConnectionString = ConfigurationManager.ConnectionStrings["connectionString"].ConnectionString, Directory = ConfigurationManager.AppSettings["directory"] }; await ObjectToDbClass.PrepareDbAsync(lacedaimon.ConnectionString); return(lacedaimon); }