public static Marshaller<T> Create<T>(Action<T, SerializationContext> serializer, Func<DeserializationContext, T> deserializer)
Creates a marshaller from specified contextual serializer and deserializer.
Note: This method is part of an experimental API that can change or be removed without any prior notice.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-09-04 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eMarshallers\u003c/code\u003e class provides utilities for creating marshallers within the \u003ccode\u003eGrpc.Core\u003c/code\u003e namespace.\u003c/p\u003e\n"],["\u003cp\u003eIt includes a \u003ccode\u003eStringMarshaller\u003c/code\u003e property that returns a marshaller specifically designed for \u003ccode\u003estring\u003c/code\u003e types, useful for testing purposes.\u003c/p\u003e\n"],["\u003cp\u003eThe \u003ccode\u003eCreate<T>\u003c/code\u003e method allows for the creation of a custom marshaller from specified serializer and deserializer functions, supporting both contextual and byte array-based serialization.\u003c/p\u003e\n"],["\u003cp\u003eThe Grpc.Core.Marshallers class inherits members from the base object class.\u003c/p\u003e\n"]]],[],null,["# Class Marshallers (2.66.0)\n\nVersion latestkeyboard_arrow_down\n\n- [2.66.0 (latest)](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core.Marshallers)\n- [2.63.0](/dotnet/docs/reference/Grpc.Core/2.63.0/Grpc.Core.Marshallers)\n- [2.48.0](/dotnet/docs/reference/Grpc.Core/2.48.0/Grpc.Core.Marshallers) \n\n public static class Marshallers\n\nUtilities for creating marshallers. \n\nInheritance\n-----------\n\n[object](https://learn.microsoft.com/dotnet/api/system.object) \\\u003e Marshallers \n\nInherited Members\n-----------------\n\n[object.Equals(object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object)) \n[object.Equals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.equals#system-object-equals(system-object-system-object)) \n[object.GetHashCode()](https://learn.microsoft.com/dotnet/api/system.object.gethashcode) \n[object.GetType()](https://learn.microsoft.com/dotnet/api/system.object.gettype) \n[object.MemberwiseClone()](https://learn.microsoft.com/dotnet/api/system.object.memberwiseclone) \n[object.ReferenceEquals(object, object)](https://learn.microsoft.com/dotnet/api/system.object.referenceequals) \n[object.ToString()](https://learn.microsoft.com/dotnet/api/system.object.tostring)\n\nNamespace\n---------\n\n[Grpc.Core](/dotnet/docs/reference/Grpc.Core/latest/Grpc.Core)\n\nAssembly\n--------\n\nGrpc.Core.Api.dll\n\nProperties\n----------\n\n### StringMarshaller\n\n public static Marshaller\u003cstring\u003e StringMarshaller { get; }\n\nReturns a marshaller for `string` type. This is useful for testing.\n\nMethods\n-------\n\n### Create\\\u003cT\\\u003e(Action\\\u003cT, SerializationContext\\\u003e, Func\\\u003cDeserializationContext, T\\\u003e)\n\n public static Marshaller\u003cT\u003e Create\u003cT\u003e(Action\u003cT, SerializationContext\u003e serializer, Func\u003cDeserializationContext, T\u003e deserializer)\n\nCreates a marshaller from specified contextual serializer and deserializer.\nNote: This method is part of an experimental API that can change or be removed without any prior notice.\n\n### Create\\\u003cT\\\u003e(Func\\\u003cT, byte\\[\\]\\\u003e, Func\\\u003cbyte\\[\\], T\\\u003e)\n\n public static Marshaller\u003cT\u003e Create\u003cT\u003e(Func\u003cT, byte[]\u003e serializer, Func\u003cbyte[], T\u003e deserializer)\n\nCreates a marshaller from specified serializer and deserializer."]]