Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions Changelog.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,55 @@
# 5.10.0 / AspNetCore 1.6.0 — MessagePack transport preview

## AspNetCore 1.6.0

* Added MessagePack wire-format support (`application/vnd.msgpack`) via [#591](https://github.com/OpenRIAServices/OpenRiaServices/pull/591)

### Enable MessagePack on the server

```csharp
var builder = WebApplication.CreateBuilder(args);
builder.Services.AddOpenRiaServices()
.AddMessagePackSerialization();
```

Optionally pass a custom `Nerdbank.MessagePack.MessagePackSerializer` to add converters or a custom comparer provider:

```csharp
builder.Services.AddOpenRiaServices()
.AddMessagePackSerialization(opt =>
{
opt.Serializer = new Nerdbank.MessagePack.MessagePackSerializer()
{
// custom converters / comparer provider
};
});
```

## Client (`OpenRiaServices.Client.DomainClients.Http`)

* Added `MessagePackHttpDomainClientFactory` — a `DomainClientFactory` that communicates with the server using MessagePack over HTTP

### Enable MessagePack on the client

```csharp
DomainContext.DomainClientFactory =
new MessagePackHttpDomainClientFactory(baseUri, httpClientFactory);
```

Optionally pass a custom serializer:

```csharp
var serializer = new MessagePackSerializer()
{
// custom converters / comparer provider
};

DomainContext.DomainClientFactory =
new MessagePackHttpDomainClientFactory(baseUri, httpClientFactory, serializer);
```

For performance benchmark data see [PR #591](https://github.com/OpenRIAServices/OpenRiaServices/pull/591).

# AspNetCore 1.5.0

* Allow configuring Serializer security settings
Expand Down
20 changes: 20 additions & 0 deletions src/OpenRiaServices.Hosting.AspNetCore/Framework/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,26 @@ builder.Services.AddOpenRiaServices()
.AddMessagePackSerialization();
```

#### Known limitations

The following types are **not** supported out of the box and require custom `MessagePackConverter<T>` implementations registered via `MessagePackSerializationOptions.Serializer.Converters`:

- **`System.Xml.Linq.XElement`** — not handled by the default serializer. See the [XElementConverter sample](https://github.com/OpenRIAServices/OpenRiaServices/blob/main/src/Test/AspNetCoreWebsite/MessagePack/XElementConverter.cs) for a reference implementation that serialises the element as a plain XML string.
- **`System.Data.Linq.Binary`** — not handled by the default serializer. See the [BinaryConverter sample](https://github.com/OpenRIAServices/OpenRiaServices/blob/main/src/Test/AspNetCoreWebsite/MessagePack/BinaryConverter.cs) for a reference implementation.

Register the converters by passing a configuration callback:

```csharp
builder.Services.AddOpenRiaServices()
.AddMessagePackSerialization(opt =>
{
opt.Serializer = new Nerdbank.MessagePack.MessagePackSerializer()
{
Converters = [new XElementConverter(), new BinaryConverter()],
};
});
```

### Configuring serializer security quotas

You can configure reader quotas to limit resource consumption and mitigate denial-of-service (DoS) attacks.
Expand Down