diff --git a/docs/Upgrading to CSLA 9.md b/docs/Upgrading to CSLA 9.md index 50489698c5..0869fcc850 100644 --- a/docs/Upgrading to CSLA 9.md +++ b/docs/Upgrading to CSLA 9.md @@ -166,6 +166,8 @@ This includes: * `char[]` * `List` +> ⚠️ Other generic collection types such as `List`, `Dictionary`, etc. are _not_ directly serializable by `SerializationInfo`. For serializable collections in business object properties, use `MobileList` or `MobileDictionary` from `Csla.Core`, or register a custom serializer for your type. + If you look at the implementation of [PocoSerializer](https://github.com/MarimerLLC/csla/blob/main/Source/Csla/Serialization/Mobile/CustomSerializers/PocoSerializer.cs) you'll see that it relies on `System.Text.Json` to serialize and deserialize the object, and stores the JSON string in the `SerializationInfo` instance. The [ClaimsPrincipalSerializer](https://github.com/MarimerLLC/csla/blob/main/Source/Csla/Serialization/Mobile/CustomSerializers/ClaimsPrincipalSerializer.cs) type has two implementations. diff --git a/docs/serialization.md b/docs/serialization.md index 10213977c0..fa70c8dbf8 100644 --- a/docs/serialization.md +++ b/docs/serialization.md @@ -10,7 +10,9 @@ The default serializer for CSLA (version 6 and later) is `MobileFormatter`. This ### Using MobileFormatter -MobileFormatter supports many basic .NET types, including "primitive" types like `int`, `string`, `DateTime`, etc. It also supports `List`, `Dictionary`, and other common collection types. It also supports any type that implements `IMobileObject`, which includes all CSLA base types. +MobileFormatter supports many basic .NET types, including "primitive" types like `int`, `string`, `DateTime`, etc. It also supports any type that implements `IMobileObject`, which includes all CSLA base types. + +> ⚠️ Standard .NET collection types such as `List` and `Dictionary` are _not_ directly serializable by `MobileFormatter`. Use `MobileList` or `MobileDictionary` from `Csla.Core` for serializable collections, or register a custom serializer for your collection type. If you create your complex types by subclassing CSLA base types and using the managed property syntax, you don't need to do anything special to support serialization.