Exemplo n.º 1
0
        static void Main()
        {
            InitRaven();
            InitMssql();

            Console.WriteLine("warmup...");
            SaveRootsInRaven(new[] { RootFactory.CreateRandomRoot() });
            SaveRootsInNhMssql(new[] { RootFactory.CreateRandomRoot() });

            var entities = new List <Tuple <string, Type> >();

            // create 10 chunks of roots (20 roots each so 200 aggregates)
            for (int i = 0; i < 10; i++)
            {
                var roots = new List <IEntity>(CreateRoots());
                entities.AddRange(roots.Select(r => new Tuple <string, Type>(r.Id, r.GetType())));

                SaveRootsInRaven(roots);
                SaveRootsInNhMssql(roots);
            }

            LoadRootsFromRaven(entities);
            LoadRootsFromNhMssql(entities);

            Console.WriteLine("Raven inserts/selects = {0} / {1}", RavenInserts.Elapsed, RavenSelects.Elapsed);
            Console.WriteLine("NH_Mssql inserts/selects = {0} / {1}", MssqlInserts.Elapsed, MssqlSelects.Elapsed);

            Console.ReadLine();
            _docStore.Dispose();
        }
        public void StartProcesses()
        {
            timer          = new Timer();
            timer.Interval = 3000;
            timer.Tick    += Cycle;

            w.Navigate(RootFactory.GetUrlForFacebookID(id, ee));
            w.DocumentCompleted += OnDocumentCompleted;
        }
Exemplo n.º 3
0
        public void StartProcesses()
        {
            timer          = new Timer();
            timer.Interval = 3000;
            timer.Tick    += Cycle;

            foreach (var page in PageFactory.PageDictionary)
            {
                page.Value.Navigate(RootFactory.GetUrlForFacebookID(id, page.Key));
                page.Value.DocumentCompleted += OnDocumentCompleted;
            }
        }
Exemplo n.º 4
0
        static IEnumerable <IEntity> CreateRoots()
        {
            var roots = new IEntity[20];

            Console.Write("Generating roots");
            for (int i = 0; i < roots.Length; i++)
            {
                roots[i] = RootFactory.CreateRandomRoot();
                Console.Write('.');
            }
            Console.WriteLine();
            return(roots);
        }
Exemplo n.º 5
0
        public static HttpConfiguration CreateHttpConfiguration(RootFactory rootFactory)
        {
            var configuration = new HttpConfiguration
            {
                DependencyResolver = new ApiControllerWithRootFactoryResolver(rootFactory)
            };

            configuration.MapHttpAttributeRoutes();
            configuration.EnableCors(new EnableCorsAttribute("*", "*", "*"));

            configuration.Formatters.JsonFormatter.UseDataContractJsonSerializer       = false;
            configuration.Formatters.JsonFormatter.SerializerSettings.ContractResolver =
                new CamelCasePropertyNamesContractResolver();

            configuration.Filters.Add(new ExceptionFilterAttribute());
            configuration.Filters.Add(new LoggingFilterAttribute());
            configuration.EnsureInitialized();

            return(configuration);
        }
Exemplo n.º 6
0
 private GooglePlaceApiServices()
 {
     _googlePlaceRepository = RootFactory <IGooglePlaceApiRepository <GooglePlace>, GooglePlaceApiRepository> .CreateInstance();
 }
Exemplo n.º 7
0
 public DeviceController(RootFactory rootFactory) : base(rootFactory)
 {
 }
 public ApiControllerWithRootFactoryResolver(RootFactory rootFactory)
 {
     this.rootFactory = rootFactory;
 }