示例#1
0
        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();
        }
示例#2
0
        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);
        }