Ejemplo n.º 1
0
        public CompositeRepository(DaoRepository sourceRepository, DataSettings dataSettings = null)
        {
            DataSettings               = dataSettings ?? DataSettings.Current;
            SourceRepository           = sourceRepository;
            ReadRepository             = new CachingRepository(sourceRepository);
            WriteRepositories          = new HashSet <IRepository>();
            WorkspacePath              = DataSettings.GetWorkspaceDirectory(this.GetType()).FullName;
            BackupRepository           = new ObjectRepository(DataSettings.GetSysDataDirectory("BackupObjectRepo").FullName);
            TypeSchemaTempPathProvider = (sd, ts) => Path.Combine(WorkspacePath, sd.Name, ts.Hash);

            WireBackup();

            sourceRepository.StorableTypes.Each(type => AddType(type));
        }