Skip to content

Commit

Permalink
Update Readme.md
Browse files Browse the repository at this point in the history
  • Loading branch information
dundich authored Jan 18, 2025
1 parent 54daae0 commit ab7470b
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions src/Sa.Outbox.PostgreSql/Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,19 +50,20 @@ public class Startup
}
```

### Example of a message consumer
### Message

```
[OutboxMessage]
public record MyMessage(string PayloadId, string Content, int TenantId) : IOutboxPayloadMessage;
```

### Consume

```csharp
using Sa.Outbox;

namespace MyNamespace
{
[OutboxMessage]
public record MyMessage(string PayloadId, string Content) : IOutboxPayloadMessage
{
public int TenantId { get; init; }
}

public class MyMessageConsumer : IConsumer<MyMessage>
{
public async ValueTask Consume(IReadOnlyCollection<IOutboxContext<MyMessage>> outboxMessages, CancellationToken cancellationToken)
Expand All @@ -77,7 +78,7 @@ namespace MyNamespace
}
```

### Example of sending a message
### Sending

```csharp
public class MessageSender(IOutboxMessagePublisher publisher)
Expand Down

0 comments on commit ab7470b

Please sign in to comment.