public SetStudioConfigToAllowSingleDb ( ) : void | ||
return | void |
public void SetStudioConfigToAllowSingleDb()
{
if (DocumentDatabase == null)
return;
var jsonDocument = DocumentDatabase.Get("Raven/StudioConfig", null);
RavenJObject doc;
RavenJObject metadata;
if(jsonDocument == null)
{
doc = new RavenJObject();
metadata = new RavenJObject();
}
else
{
doc = jsonDocument.DataAsJson;
metadata = jsonDocument.Metadata;
}
doc["WarnWhenUsingSystemDatabase"] = false;
DocumentDatabase.Put("Raven/StudioConfig", null, doc, metadata, null);
}
public static void WaitForUserToContinueTheTest(EmbeddableDocumentStore documentStore, bool debug = true) { if (debug && Debugger.IsAttached == false) return; documentStore.SetStudioConfigToAllowSingleDb(); documentStore.DatabaseCommands.Put("Pls Delete Me", null, RavenJObject.FromObject(new { StackTrace = new StackTrace(true) }), new RavenJObject()); documentStore.Configuration.AnonymousUserAccessMode = AnonymousUserAccessMode.Admin; using (var server = new HttpServer(documentStore.Configuration, documentStore.DocumentDatabase)) { server.StartListening(); Process.Start(documentStore.Configuration.ServerUrl); // start the server do { Thread.Sleep(100); } while (documentStore.DatabaseCommands.Get("Pls Delete Me") != null && (debug == false || Debugger.IsAttached)); } }