Exemplo n.º 1
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            var cfg = new Config();

            var factory = new SharepointClientFactory(cfg);

            var inFileDataStorage = new FileDataStorage();


            System.Globalization.CultureInfo.DefaultThreadCurrentCulture   = System.Globalization.CultureInfo.CurrentCulture;
            System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = System.Globalization.CultureInfo.CurrentUICulture;

//            var sw = Stopwatch.StartNew();
            //        var sync = new DataStorageUpdater(inFileDataStorage, factory, new ConfluenceClient(new Config()));
            //           sync.Update();
            //           sw.Stop();
            //           var elapsed = sw.ElapsedMilliseconds;

            Debug.WriteLine("");
        }
Exemplo n.º 2
0
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();

            WebApiConfig.Register(GlobalConfiguration.Configuration);
            FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
            RouteConfig.RegisterRoutes(RouteTable.Routes);

            var cfg = new Config();

            var factory = new SharepointClientFactory(cfg);

            var inFileDataStorage = new FileDataStorage();

            System.Globalization.CultureInfo.DefaultThreadCurrentCulture = System.Globalization.CultureInfo.CurrentCulture;
            System.Globalization.CultureInfo.DefaultThreadCurrentUICulture = System.Globalization.CultureInfo.CurrentUICulture;

            //            var sw = Stopwatch.StartNew();
            //        var sync = new DataStorageUpdater(inFileDataStorage, factory, new ConfluenceClient(new Config()));
            //           sync.Update();
            //           sw.Stop();
            //           var elapsed = sw.ElapsedMilliseconds;

            Debug.WriteLine("");
        }
Exemplo n.º 3
0
        public async Task TestFileStorage()
        {
            var storage = new FileDataStorage();
            await storage.Save(_metadata);

            var data = await storage.Retrieve();

            CollectionAssert.AreEqual(data.RegisteredTypes.Select(metadata => metadata.TypeName).ToList(),
                                      _metadata.RegisteredTypes.Select(metadata => metadata.TypeName).ToList());
        }
Exemplo n.º 4
0
        public static IServiceCollection UseFileRepositories(this IServiceCollection services, string path)
        {
            var municipalityDataStorage = new FileDataStorage <Municipality>(path);
            var municipalityRepository  = new MunicipalityRepository(municipalityDataStorage);

            var populationFrameDataStorage = new FileDataStorage <PopulationFrame>(path);
            var populationFrameRepository  = new PopulationFrameRepository(populationFrameDataStorage);

            services.AddSingleton(typeof(IMunicipalityRepository), municipalityRepository);
            services.AddSingleton(typeof(IPopulationFrameRepository), populationFrameRepository);

            return(services);
        }
Exemplo n.º 5
0
 public TransactionsService(Guid walletGuid)
 {
     _storage = new FileDataStorage <DBTransaction>(walletGuid.ToString("N"));
 }