Ejemplo n.º 1
0
 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);
     }
 }
Ejemplo n.º 2
0
 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);
     }
     
 }
Ejemplo n.º 3
0
        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);
        }
Ejemplo n.º 4
0
 public void RegisterUpdate(UpdateBatch batch, object entity, string json)
 {
     throw new NotSupportedException();
 }
Ejemplo n.º 5
0
 public SprocCall(UpdateBatch parent, string sprocName)
 {
     _parent = parent;
     _sprocName = sprocName;
 }