Example #1
0
        private async Task RegisterServices()
        {
            StorageFolder localFolder = ApplicationData.Current.LocalFolder;
            var           folder      = await localFolder.CreateFolderAsync("WarColorsData", CreationCollisionOption.OpenIfExists);

            container
            .RegisterHandler(typeof(IDatabase), container => new Database(container.GetInstance <IPlatform>(), folder.Path));

            container
            .PerRequest <IPlatform, MarcelloDB.uwp.Platform>();
        }
Example #2
0
        private void RegisterServices()
        {
            string path = Path.Combine(
                System.Environment.GetFolderPath(System.Environment.SpecialFolder.Personal),
                "WarColorsData");

            if (!System.IO.Directory.Exists(path))
            {
                System.IO.Directory.CreateDirectory(path);
            }

            container
            .RegisterHandler(typeof(IDatabase), container => new Database(container.GetInstance <IPlatform>(), path));

            container
            .PerRequest <IPlatform, MarcelloDB.netfx.Platform>();
        }