> For the complete documentation index, see [llms.txt](https://runninghorse.gitbook.io/gdnet/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://runninghorse.gitbook.io/gdnet/net.scene/onserializerpc.md).

# OnSerializeRpc

```
    /// <summary>
    /// 当内核序列化远程函数时调用, 如果想改变内核rpc的序列化方式, 可重写定义序列化协议
    /// </summary>
    /// <param name="model"></param>
    /// <returns></returns>
    protected virtual byte[] OnSerializeRpc(RPCModel model) { return OnSerializeRPC(model); }

    protected internal byte[] OnSerializeRpcInternal(RPCModel model) { return NetConvert.Serialize(model); }
```
