예제 #1
0
        private DocumentChange[] GetChanges(UpdateBatch batch)
        {
            _updates.Keys.Each(type =>
            {
                var storage = _schema.StorageFor(type);

                _updates[type].Each(o => storage.RegisterUpdate(batch, o));
            });

            _deletes.Keys.Each(type =>
            {
                var storage = _schema.StorageFor(type);
                var mapping = _schema.MappingFor(type);

                _deletes[type].Each(id => batch.Delete(mapping.TableName, id.Id, storage.IdType));
            });

            var changes = detectTrackerChanges();

            changes.GroupBy(x => x.DocumentType).Each(group =>
            {
                var storage = _schema.StorageFor(group.Key);

                group.Each(c =>
                {
                    storage.RegisterUpdate(batch, c.Document, c.Json);
                });
            });

            return(changes);
        }
예제 #2
0
파일: Delete.cs 프로젝트: Xamarui/marten
 public void Configure(MartenExpressionParser parser, IDocumentStorage storage, IDocumentMapping mapping, UpdateBatch batch)
 {
     if (Where == null)
     {
         batch.Delete(mapping.Table, Id, storage.IdType);
     }
     else
     {
         batch.DeleteWhere(mapping.Table, Where);
     }
 }
예제 #3
0
 public void Configure(MartenExpressionParser parser, IDocumentStorage storage, IQueryableDocument mapping, UpdateBatch batch)
 {
     if (Where == null)
     {
         batch.Delete(mapping.Table, Id, storage.IdType);
     }
     else
     {
         batch.DeleteWhere(mapping.Table, Where);
     }
 }
예제 #4
0
파일: Delete.cs 프로젝트: nieve/marten
 public void Configure(MartenExpressionParser parser, IDocumentStorage storage, IDocumentMapping mapping, UpdateBatch batch)
 {
     if (Query == null)
     {
         batch.Delete(mapping.QualifiedTableName, Id, storage.IdType);
     }
     else
     {
         var where = Query.BuildWhereClause();
         batch.DeleteWhere(mapping.QualifiedTableName, where);
     }
     
 }