This is Orleans in the case that the serialization check type supports Orleans built-in high-speed serialization, when using immutable<> wrapper and type declarations, there is immutableattribute, the effect is the same. So there is no need to repeat the call to Asimmutable () for a type that has already been added Immutableattribute
Internal Static BOOLIsorleansshallowcopyable ( ThisType T) { if(t.isprimitive | | t.isenum | | t =typeof(string) || t = =typeof(DateTime) | | t = =typeof(Decimal) | |T==typeof(immutable<>)) return true; if(T.getcustomattributes (typeof(Immutableattribute),false). Length >0) return true; if(T.isgenerictype && t.getgenerictypedefinition () = =typeof(immutable<>)) return true; if(T.isvaluetype &&!t.isgenerictype &&!)t.isgenerictypedefinition) { BOOLresult; Lock(shallowcopyablevaluetypes) {if(Shallowcopyablevaluetypes.trygetvalue (T.typehandle, outresult)) returnresult; } result= T.getfields (). All (f =!) ( F.fieldtype = = t) &&f.fieldtype.isorleansshallowcopyable ()); Lock(shallowcopyablevaluetypes) {Shallowcopyablevaluetypes[t.typehandle]=result; } returnresult; } return false; }
Considerations for optimizing replication using immutable