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, IDocumentMapping mapping, UpdateBatch batch) { if (Query == null) { batch.Delete(mapping.QualifiedTableName, Id, storage.IdType); } else { var where = Query.BuildWhereClause(); batch.DeleteWhere(mapping.QualifiedTableName, where); } }
public void RegisterUpdate(UpdateBatch batch, object entity) { var stream = entity.As<EventStream>(); var streamTypeName = stream.AggregateType == null ? null : _graph.AggregateAliasFor(stream.AggregateType); var eventTypes = stream.Events.Select(x => _graph.EventMappingFor(x.Data.GetType()).EventTypeName).ToArray(); var bodies = stream.Events.Select(x => batch.Serializer.ToJson(x.Data)).ToArray(); var ids = stream.Events.Select(x => x.Id).ToArray(); batch.Sproc(AppendEventFunction, new EventStreamVersioningCallback(stream)) .Param("stream", stream.Id) .Param("stream_type", streamTypeName) .Param("event_ids", ids) .Param("event_types", eventTypes) .JsonBodies("bodies", bodies); }
public void RegisterUpdate(UpdateBatch batch, object entity, string json) { throw new NotSupportedException(); }
public SprocCall(UpdateBatch parent, string sprocName) { _parent = parent; _sprocName = sprocName; }