File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
src/BootstrapBlazor.Server/Components/Samples Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -110,3 +110,22 @@ class MockEntity
110110 return new Foo () { Id = data .Span [0 ], Name = name };
111111 }
112112} </Pre >
113+
114+ <p class =" code-label" >针对第三方程序集的数据类型解决方案如下:</p >
115+ <p >使用 <code ></code ></p >
116+
117+ <Pre >builder.Services.ConfigureSocketDataConverters(options =>
118+ {
119+ options .AddTypeConverter < ; MockEntity > ; ();
120+ options .AddPropertyConverter < ; MockEntity > ; (entity = & gt ; entity .Header , new SocketDataPropertyConverterAttribute ()
121+ {
122+ Offset = 0 ,
123+ Length = 5
124+ });
125+ options .AddPropertyConverter < ; MockEntity > ; (entity = & gt ; entity .Body , new SocketDataPropertyConverterAttribute ()
126+ {
127+ Offset = 5 ,
128+ Length = 2
129+ });
130+ } );
131+ </Pre >
You can’t perform that action at this time.
0 commit comments