public static void Handle(ItemCreated created, IDocumentSession session,
                           Jasper.Messaging.Tracking.MessageTracker tracker,
                           Envelope envelope)
 {
     session.Store(created);
     tracker.Record(created, envelope);
 }
        public static async Task Handle(
            ItemCreated created,
            NpgsqlTransaction tx, // the current transaction
            Jasper.Messaging.Tracking.MessageTracker tracker,
            Envelope envelope)
        {
            // Using some extension method helpers inside of Jasper here
            await tx.CreateCommand("insert into receiver.item_created (id, name) values (@id, @name)")
            .With("id", created.Id)
            .With("name", created.Name)
            .ExecuteNonQueryAsync();

            tracker.Record(created, envelope);
        }
        public static async Task Handle(
            ItemCreated created,
            SqlConnection conn, // the connection for the container scope
            SqlTransaction tx,  // the current transaction
            Jasper.Messaging.Tracking.MessageTracker tracker,
            Envelope envelope)
        {
            await conn.CreateCommand(tx, "insert into receiver.item_created (id, name) values (@id, @name)")
            .With("id", created.Id)
            .With("name", created.Name)
            .ExecuteNonQueryAsync();

            tracker.Record(created, envelope);
        }
Example #4
0
 public void Handle(CascadedMessage message, Jasper.Messaging.Tracking.MessageTracker tracker, Envelope envelope)
 {
     tracker.Record(message, envelope);
 }