MetadataFactory Class
Definition
Provides access to factory methods for maintaining metadata in models.
public static class MetadataFactory
- Inheritance
-
MetadataFactory
Examples
This example shows how to persist a custom metadata value on a request and retrieve it later in the pipeline.
using Savvyio;
namespace ExampleApp;
public sealed class MetadataFactoryExample
{
public string GetTenant()
{
var command = new CreateOrderCommand("ORD-42");
MetadataFactory.Set(command, "tenant", "eu-west");
return (string)MetadataFactory.Get(command, "tenant");
}
}
public sealed record CreateOrderCommand(string OrderId) : Request;
Methods
| Name | Description |
|---|---|
| Get<T>(T, string) | Gets the value associates to the |
| Set<T>(T, string, object) | Assigns a new |