public CampaignController(DocumentStoreHolder holder, IEnumerable <ICharacterSheet> characterSheetTypes) { MongoDb = holder.GetDefaultDatabase(); CampaignCollection = MongoDb.GetCollection <Campaign>("CampaignCollection"); CharacterCollection = MongoDb.GetCollection <dynamic>("RpgCharModels"); CharacterSheetTypes = characterSheetTypes; }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); DocumentStoreHolder.Initailize(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); }
public OrderController( ILogger <OrderController> logger, DocumentStoreHolder documentStoreHolder, IEventBus eventBus) { _logger = logger; _documentStoreHolder = documentStoreHolder; _eventBus = eventBus; }
public override void OnActionExecuting(HttpActionContext filterContext) { DocumentStoreHolder.Url = _uri ?? null; DocumentStoreHolder.ConnectionStringName = !string.IsNullOrEmpty(_connectionStringName) ? _connectionStringName : null; filterContext.Request.Properties["RavenDocumentStore"] = DocumentStoreHolder.TryAddSession(filterContext.ControllerContext.Controller); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); DocumentStoreHolder.Initailize(); TryCreatingIndexesOrRedirectToErrorPage(); RegisterGlobalFilters(GlobalFilters.Filters); RegisterRoutes(RouteTable.Routes); this.InitApp(LifestyleType.PerWebRequest); }
public IDocumentStore GetDocumentStore() { if (_inMemory) { return(DocumentStoreHolder.GetInMemoryStore()); } return(DocumentStoreHolder.GetStore()); }
public DeleteUnusedDatabasesTask(DocumentStoreHolder documentStoreHolder, Settings settings, ILogger <DeleteUnusedDatabasesTask> logger) { _documentStoreHolder = documentStoreHolder; _logger = logger; var expirationSettings = settings.DeleteUnusedDatabases.ExpirationSpan; _expirationSpan = expirationSettings.ToTimeSpan(); }
public NewOrderCreatedIntegrationEventHandler( ILogger <NewOrderCreatedIntegrationEventHandler> logger, IEggService eggService, DocumentStoreHolder documentStoreHolder) { _logger = logger; _eggService = eggService; _documentStoreHolder = documentStoreHolder; }
public void Configuration(IAppBuilder app) { DocumentStoreHolder.SetDbInfo("DemoServer", "Northwind", "Media"); var configuration = new HttpConfiguration(); DemoServer.Configure(configuration); app.UseWebApi(configuration); }
protected void Application_Start() { DocumentStoreHolder.Initialize(); ImportData.Import(DocumentStoreHolder.Store); WebApiSetup.Setup(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalConfiguration.Configuration.Filters); RouteConfig.RegisterRoutes(GlobalConfiguration.Configuration.Routes); CommonSetup.Setup(); }
protected IDocumentStore NewDocumentStore() { var store = new EmbeddableDocumentStore { RunInMemory = true }; DocumentStoreHolder.SetupConventions(store.Conventions); store.Initialize(); documentStores.Add(store); return(store); }
private static void Main(string[] args) { Console.InputEncoding = Encoding.UTF8; Console.OutputEncoding = Encoding.UTF8; DocumentStoreHolder.Initialize(); new OpenSiddurOpenDocumentImporter().Import(); //new CommandsRunner().LookForCommands(); DocumentStoreHolder.Shutdown(); }
protected void Application_Start() { AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(GlobalConfiguration.Configuration); FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters); RouteConfig.RegisterRoutes(RouteTable.Routes); JsonMediaTypeFormatter jsonFormatter = GlobalConfiguration.Configuration.Formatters.JsonFormatter; // jsonFormatter.SerializerSettings.ContractResolver = new CamelCasePropertyNamesContractResolver(); jsonFormatter.SerializerSettings.Converters.Add(new StringEnumConverter()); DocumentStoreHolder.Initialize(); }
public static void Initialize() { foreach (var configurationItem in Configuration.Init()) { DocumentStoreHolder.Init(configurationItem.Endpoint); foreach (var destination in configurationItem.ToPopulate) { options = new SessionOptions { Database = destination.Database }; SeedEverything(); } } }
private void AddItemsToDatabase(List <SiddurSnippet> snippets) { using (var session = DocumentStoreHolder.OpenSession()) { foreach (var siddurSnippet in snippets) { if (siddurSnippet.Slug == null) { siddurSnippet.Id = "rawImport/SiddurSnippet/" + siddurSnippet.Id; } else { siddurSnippet.Id = null; } session.Store(siddurSnippet); } session.SaveChanges(); } }
public static void ExcuteLater(ICommand command) { Task.Factory.StartNew(() => { var succcessfully = false; try { DocumentStoreHolder.TryAddSession(command); command.Execute(); succcessfully = true; } finally { DocumentStoreHolder.TryComplete(command, succcessfully); } }, TaskCreationOptions.LongRunning) .ContinueWith(task => { ErrorLog.GetDefault(null).Log(new Error(task.Exception)); }, TaskContinuationOptions.OnlyOnFaulted); }
public static void Cleanup() { foreach (var configurationItem in Configuration.Init()) { DocumentStoreHolder.Init(configurationItem.Endpoint); foreach (var itemToDelete in configurationItem.ToDelete) { var options = new SessionOptions { Database = itemToDelete.Database }; if (itemToDelete.Collection.Equals("ALL")) { ClearDatabase(options); continue; } DeleteItemsFromCollection(options, itemToDelete.Collection); } } }
static void Main(string[] args) { string demoServerUrl = "localhost:9090"; string databaseName = "Demo"; if (args.Length > 0) { if (args[0] != null) { switch (args[0]) { case "-h": case "-help": case "--help": case "/h": case "/?": { Console.WriteLine(@""); Console.WriteLine(@"DemoServer Usage : demoserver [-h] [-ds address] [-dn databaseName]"); Console.WriteLine(@""); Console.WriteLine(@" -ds address : Demo Server's address."); Console.WriteLine(@" Default : 'localhost:9090'"); Console.WriteLine(@""); Console.WriteLine(@" -dn address : Database Name"); Console.WriteLine(@" Default : 'Demo'"); Console.WriteLine(@""); Console.WriteLine(@"Note : Do not add 'http://' prefix to addresses."); Console.WriteLine(@""); } return; default: { bool readDs = false; bool readDn = false; for (int i = 0; i < args.Length; i++) { if (args[i] != null) { if (readDs == true) { demoServerUrl = args[i]; readDs = false; continue; } if (readDn == true) { databaseName = args[i]; readDn = false; continue; } if (args[i].Equals("-ds")) { readDs = true; } else if (args[i].Equals("-dn")) { readDn = true; } else { Console.WriteLine(""); Console.WriteLine("Error : Bad usage parameters. Use -h for help."); Console.WriteLine(""); return; } } } } break; } } } demoServerUrl = string.Format("Http://{0}", demoServerUrl); var dsUri = new Uri(demoServerUrl); DocumentStoreHolder.SetDbInfo("DemoServer", databaseName, "Media"); var server = new DemoServer(); server.Start(dsUri.Host, dsUri.Port); }
public ApiController(DocumentStoreHolder holder, IOptions <MongoConfig> options) { MongoDb = holder.Store.GetDatabase("RpgCharModelDb"); MongoConfig = options.Value; }
public FiveECharController(DocumentStoreHolder holder) { MongoDb = holder.GetDefaultDatabase(); }
public EggService(ILogger <EggService> _logger, DocumentStoreHolder documentStoreHolder) { this._logger = _logger; _documentStoreHolder = documentStoreHolder; }
public override void OnActionExecuting(ActionExecutingContext filterContext) { DocumentStoreHolder.TryAddSession(filterContext.Controller); }
public Handler(DocumentStoreHolder storeHolder) { _store = storeHolder.Store; }
public MediaStoreCache(IMemoryCache memoryCache, DocumentStoreHolder documentStoreHolder, DatabaseName databaseName) : base(memoryCache, documentStoreHolder) { _databaseName = databaseName; }
public GenericCharacterController(DocumentStoreHolder holder, IEnumerable <ICharacterSheet> characterSheetTypes) { MongoDb = holder.GetDefaultDatabase(); this.characterSheetTypes = characterSheetTypes; }
public override void OnActionExecuted(ActionExecutedContext filterContext) { DocumentStoreHolder.TryComplete(filterContext.Controller, filterContext.Exception == null); }
public Handler(DocumentStoreHolder documentStore) { _store = documentStore.Store; }
public EggPlantController(ILogger <EggPlantController> logger, DocumentStoreHolder documentStoreHolder) { _logger = logger; _documentStoreHolder = documentStoreHolder; }
protected DocumentStoreCache(IMemoryCache memoryCache, DocumentStoreHolder documentStoreHolder) { _memoryCache = memoryCache; _documentStoreHolder = documentStoreHolder; }