Skip to content

Commit

Permalink
readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KSemenenko committed Jun 6, 2023
1 parent 47a9c46 commit 8d86ce7
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ namespace ManagedCode.Communication.Extensions;

public static class OrleansExtensions
{
public static ISiloBuilder UseOrleansCommunication(this ISiloBuilder builder)
public static ISiloBuilder UseOrleansCommunication(this ISiloBuilder siloBuilder)
{
return builder.AddIncomingGrainCallFilter<CommunicationIncomingGrainCallFilter>();
return siloBuilder.AddIncomingGrainCallFilter<CommunicationIncomingGrainCallFilter>();
}

public static IClientBuilder UseOrleansCommunication(this IClientBuilder builder)
public static IClientBuilder UseOrleansCommunication(this IClientBuilder clientBuilder)
{
return builder.AddOutgoingGrainCallFilter<CommunicationOutgoingGrainCallFilter>();
return clientBuilder.AddOutgoingGrainCallFilter<CommunicationOutgoingGrainCallFilter>();
}
}
}

46 changes: 45 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,13 @@ if(fail.IsFailed)
}
```

From
Collection Result:

```csharp
var collection = CollectionResult<int>.Succeed(Enumerable.Repeat(4, 100), 5, 100, 15000);
```

From:

```csharp
var succeed = await Result<MyObject>.From(() => GetMyResult());
Expand All @@ -78,6 +84,44 @@ if(succeed.IsSuccess)
}
```

## Global handlers

Also we have global handlers for WebApi and SignalR

```csharp
builder.Services.AddCommunication(option =>
{
option.ShowErrorDetails = true;
});

```

SignalR global hub filter

```csharp
builder.Services.AddSignalR(options => options.AddCommunicationHubFilter());
```

WebApi middleware

```csharp
app.UseCommunication();
```

Orleans

silo:

```csharp
siloBuilder.UseOrleansCommunication();
```

client:

```csharp
clientBuilder.UseOrleansCommunication();
```

## Conclusion

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

0 comments on commit 8d86ce7

Please sign in to comment.