public string DocumentStorageCodeFor <T>() { var documentMapping = _schema.MappingFor(typeof(T)); if (documentMapping is DocumentMapping) { return(DocumentStorageBuilder.GenerateDocumentStorageCode(new[] { documentMapping.As <DocumentMapping>() })); } return($"Docuemnt Storage for {typeof (T).FullName} is not generated"); }
public void generate_code() { var mapping = new DocumentMapping(typeof(Target)); mapping.DuplicateField("Number"); mapping.DuplicateField("Date"); var code = DocumentStorageBuilder.GenerateDocumentStorageCode(new[] { mapping }); Debug.WriteLine(code); }
public void load_with_small_batch() { // SAMPLE: using_bulk_insert // This is just creating some randomized // document data var data = Target.GenerateRandomData(100).ToArray(); // Load all of these into a Marten-ized database theStore.BulkInsert(data); // And just checking that the data is actually there;) theSession.Query <Target>().Count().ShouldBe(data.Length); // ENDSAMPLE theSession.Load <Target>(data[0].Id).ShouldNotBeNull(); Debug.WriteLine(DocumentStorageBuilder.GenerateDocumentStorageCode(new DocumentMapping[] { new DocumentMapping(typeof(Target)), })); }
public string DocumentStorageCodeFor <T>() { return(DocumentStorageBuilder.GenerateDocumentStorageCode(new[] { _schema.MappingFor(typeof(T)) })); }
public void WriteStorageCode(string file) { var code = DocumentStorageBuilder.GenerateDocumentStorageCode(Options.AllDocumentMappings.ToArray()); new FileSystem().WriteStringToFile(file, code); }