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); }
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); } }
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); } }
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); } }