コード例 #1
0
 private void RegisterServices()
 {
     container
     .PerRequest <IProjectRepository, ProjectRepository>()
     .PerRequest <ISeedDatabase, SeedDatabase>()
     .PerRequest <IFactory <IProjectRepository>, Factory <IProjectRepository> >();
 }
コード例 #2
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>();
        }
コード例 #3
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>();
        }