ServiceModel.Grpc.MemoryPackMarshaller
1.11.1
dotnet add package ServiceModel.Grpc.MemoryPackMarshaller --version 1.11.1
NuGet\Install-Package ServiceModel.Grpc.MemoryPackMarshaller -Version 1.11.1
<PackageReference Include="ServiceModel.Grpc.MemoryPackMarshaller" Version="1.11.1" />
paket add ServiceModel.Grpc.MemoryPackMarshaller --version 1.11.1
#r "nuget: ServiceModel.Grpc.MemoryPackMarshaller, 1.11.1"
// Install ServiceModel.Grpc.MemoryPackMarshaller as a Cake Addin #addin nuget:?package=ServiceModel.Grpc.MemoryPackMarshaller&version=1.11.1 // Install ServiceModel.Grpc.MemoryPackMarshaller as a Cake Tool #tool nuget:?package=ServiceModel.Grpc.MemoryPackMarshaller&version=1.11.1
ServiceModel.Grpc.MemoryPackMarshaller
ServiceModel.Grpc
enables applications to communicate with gRPC services using a code-first approach (no .proto files), helps to get around limitations of gRPC protocol like "only reference types", "exact one input", "no nulls", "no value-types". Provides exception handling. Helps to migrate existing WCF solution to gRPC with minimum effort.
ServiceModel.Grpc.MemoryPackMarshaller
is package with IMarshallerFactory
implementation, based on MemoryPack serializer.
Configure ClientFactory
Instruct ClientFactory
to use MemoryPackMarshallerFactory
as default marshaller for all clients.
IClientFactory defaultClientFactory
= new ClientFactory(new ServiceModelGrpcClientOptions
{
// set MemoryPackMarshaller as default Marshaller
MarshallerFactory = MemoryPackMarshallerFactory.Default
});
Instruct ClientFactory
to use MemoryPackMarshallerFactory
for concrete client.
// client factory with default (DataContractMarshallerFactory) marshaller
IClientFactory defaultClientFactory = new ClientFactory();
// set MemoryPackMarshaller only for ICalculator client
defaultClientFactory.AddClient<ICalculator>(options =>
{
options.MarshallerFactory = MemoryPackMarshallerFactory.Default;
});
Configure ServiceModel.Grpc.AspNetCore
Instruct ServiceModel.Grpc code-first to use MemoryPackMarshallerFactory
as default marshaller for all endpoints.
var builder = WebApplication.CreateBuilder();
// enable ServiceModel.Grpc code-first
builder.Services.AddServiceModelGrpc(options =>
{
// set MemoryPackMarshaller as default Marshaller
options.DefaultMarshallerFactory = MemoryPackMarshallerFactory.Default;
});
Instruct ServiceModel.Grpc code-first to use MemoryPackMarshallerFactory
for concrete endpoint.
var builder = WebApplication.CreateBuilder();
// enable ServiceModel.Grpc code-first with default (DataContractMarshallerFactory) marshaller
builder.Services.AddServiceModelGrpc();
// set MemoryPackMarshaller only for Calculator endpoint
builder.Services.AddServiceModelGrpcServiceOptions<Calculator>(options =>
{
options.MarshallerFactory = MemoryPackMarshallerFactory.Default;
});
Configure ServiceModel.Grpc.SelfHost
Instruct ServiceModel.Grpc code-first to use MemoryPackMarshallerFactory
.
var server = new Grpc.Core.Server();
// set MemoryPackMarshaller for Calculator endpoint
server.Services.AddServiceModelTransient(
()=> new Calculator(),
options =>
{
options.MarshallerFactory = MemoryPackMarshallerFactory.Default;
});
Links
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 is compatible. |
.NET Core | netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
.NET Standard | netstandard2.1 is compatible. |
MonoAndroid | monoandroid was computed. |
MonoMac | monomac was computed. |
MonoTouch | monotouch was computed. |
Tizen | tizen60 was computed. |
Xamarin.iOS | xamarinios was computed. |
Xamarin.Mac | xamarinmac was computed. |
Xamarin.TVOS | xamarintvos was computed. |
Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.1
- MemoryPack (>= 1.21.3)
- ServiceModel.Grpc (>= 1.11.1)
- ServiceModel.Grpc.DesignTime (>= 1.11.1)
-
net8.0
- MemoryPack (>= 1.21.3)
- ServiceModel.Grpc (>= 1.11.1)
- ServiceModel.Grpc.DesignTime (>= 1.11.1)
-
net9.0
- MemoryPack (>= 1.21.3)
- ServiceModel.Grpc (>= 1.11.1)
- ServiceModel.Grpc.DesignTime (>= 1.11.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.