Beispiel #1
0
        public void Insert <TDocument>(TDocument instance, InsertOptions options = null) where TDocument : class
        {
            var command = builder.PrepareInsert(new[] { instance }, options);

            configuration.Hooks.BeforeInsert(instance, command.Mapping, this);
            ExecuteNonQuery(command);
            configuration.Hooks.AfterInsert(instance, command.Mapping, this);
            configuration.RelatedDocumentStore.PopulateRelatedDocuments(this, instance);
        }
        public void InsertSingleDocument()
        {
            var document = new TestDocument {
                AColumn = "AValue", NotMapped = "NonMappedValue"
            };

            var result = builder.PrepareInsert(new[] { document }, InsertOptions.Default);

            this.Assent(Format(result));
        }