コード例 #1
0
 public void Cleanup()
 {
     if (!String.IsNullOrEmpty(connectionString))
     {
         RavenDbHelper.DeleteDatabase(connectionString);
     }
 }
 public void Initialize()
 {
     connectionString = Settings.RavenDbConnectionString(Guid.NewGuid().ToString("N"));
     sampleData       = GetSampleData();
     RavenDbHelper.CreateSampleDatabase(connectionString, sampleData);
     RavenDbHelper.CreateIndex(connectionString, "AllDocs/ByAge", "from doc in docs select new { Age = doc.Age }");
 }
コード例 #3
0
 public void Initialize()
 {
     connectionString = Settings.RavenDbConnectionString(Guid.NewGuid().ToString("N"));
     sampleData       = SampleData
                        .GetSimpleDocuments(NumberOfItems)
                        // Exclude DateTimeProperty since it is returned as a string from RavenDB and ruins the validation
                        .Select(i => i
                                .Where(p => p.Key != "DateTimeProperty")
                                .ToDictionary(p => p.Key, p => p.Value))
                        .ToArray();
     RavenDbHelper.CreateSampleDatabase(connectionString, sampleData);
 }