Skip to content

Commit 8d86ce7

Browse files
committed
readme
1 parent 47a9c46 commit 8d86ce7

File tree

2 files changed

+51
-6
lines changed

2 files changed

+51
-6
lines changed

ManagedCode.Communication.Orleans/Extensions/OrleansExtensions.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ namespace ManagedCode.Communication.Extensions;
55

66
public static class OrleansExtensions
77
{
8-
public static ISiloBuilder UseOrleansCommunication(this ISiloBuilder builder)
8+
public static ISiloBuilder UseOrleansCommunication(this ISiloBuilder siloBuilder)
99
{
10-
return builder.AddIncomingGrainCallFilter<CommunicationIncomingGrainCallFilter>();
10+
return siloBuilder.AddIncomingGrainCallFilter<CommunicationIncomingGrainCallFilter>();
1111
}
1212

13-
public static IClientBuilder UseOrleansCommunication(this IClientBuilder builder)
13+
public static IClientBuilder UseOrleansCommunication(this IClientBuilder clientBuilder)
1414
{
15-
return builder.AddOutgoingGrainCallFilter<CommunicationOutgoingGrainCallFilter>();
15+
return clientBuilder.AddOutgoingGrainCallFilter<CommunicationOutgoingGrainCallFilter>();
1616
}
17-
}
17+
}
18+

README.md

Lines changed: 45 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,13 @@ if(fail.IsFailed)
6767
}
6868
```
6969

70-
From
70+
Collection Result:
71+
72+
```csharp
73+
var collection = CollectionResult<int>.Succeed(Enumerable.Repeat(4, 100), 5, 100, 15000);
74+
```
75+
76+
From:
7177

7278
```csharp
7379
var succeed = await Result<MyObject>.From(() => GetMyResult());
@@ -78,6 +84,44 @@ if(succeed.IsSuccess)
7884
}
7985
```
8086

87+
## Global handlers
88+
89+
Also we have global handlers for WebApi and SignalR
90+
91+
```csharp
92+
builder.Services.AddCommunication(option =>
93+
{
94+
option.ShowErrorDetails = true;
95+
});
96+
97+
```
98+
99+
SignalR global hub filter
100+
101+
```csharp
102+
builder.Services.AddSignalR(options => options.AddCommunicationHubFilter());
103+
```
104+
105+
WebApi middleware
106+
107+
```csharp
108+
app.UseCommunication();
109+
```
110+
111+
Orleans
112+
113+
silo:
114+
115+
```csharp
116+
siloBuilder.UseOrleansCommunication();
117+
```
118+
119+
client:
120+
121+
```csharp
122+
clientBuilder.UseOrleansCommunication();
123+
```
124+
81125
## Conclusion
82126

83127
In summary, our library provides a convenient and easy-to-use solution for handling the result of a function that may

0 commit comments

Comments
 (0)