@@ -2644,8 +2644,6 @@ public async Task NewFlushingAsync()
2644
2644
[ Test ]
2645
2645
public async Task PersistCollectionsAsync ( )
2646
2646
{
2647
- TestsContext . AssumeSystemTypeIsSerializable ( ) ;
2648
-
2649
2647
ISession s = OpenSession ( ) ;
2650
2648
ITransaction txn = s . BeginTransaction ( ) ;
2651
2649
IEnumerator enumer = ( await ( s . CreateQuery ( "select count(*) from b in class Bar" ) . EnumerableAsync ( ) ) ) . GetEnumerator ( ) ;
@@ -2843,7 +2841,20 @@ public async Task PersistCollectionsAsync()
2843
2841
2844
2842
// serialize and then deserialize the session.
2845
2843
Stream stream = new MemoryStream ( ) ;
2846
- IFormatter formatter = new BinaryFormatter ( ) ;
2844
+ #if NETFX
2845
+ var formatter = new BinaryFormatter ( ) ;
2846
+ #else
2847
+ var selector = new SurrogateSelector ( ) ;
2848
+ selector . AddSurrogate (
2849
+ typeof ( CultureInfo ) ,
2850
+ new StreamingContext ( StreamingContextStates . All ) ,
2851
+ new CultureInfoSerializationSurrogate ( ) ) ;
2852
+ selector . ChainSelector ( new SerializationHelper . SurrogateSelector ( ) ) ;
2853
+ var formatter = new BinaryFormatter
2854
+ {
2855
+ SurrogateSelector = selector
2856
+ } ;
2857
+ #endif
2847
2858
formatter . Serialize ( stream , s ) ;
2848
2859
2849
2860
s . Close ( ) ;
@@ -4659,8 +4670,6 @@ public async Task SaveDeleteAsync()
4659
4670
[ Test ]
4660
4671
public async Task ProxyArrayAsync ( )
4661
4672
{
4662
- TestsContext . AssumeSystemTypeIsSerializable ( ) ;
4663
-
4664
4673
ISession s = OpenSession ( ) ;
4665
4674
GlarchProxy g = new Glarch ( ) ;
4666
4675
Glarch g1 = new Glarch ( ) ;
@@ -4697,7 +4706,12 @@ public async Task ProxyArrayAsync()
4697
4706
4698
4707
// serialize the session.
4699
4708
Stream stream = new MemoryStream ( ) ;
4700
- IFormatter formatter = new BinaryFormatter ( ) ;
4709
+ var formatter = new BinaryFormatter ( )
4710
+ {
4711
+ #if ! NETFX
4712
+ SurrogateSelector = new SerializationHelper . SurrogateSelector ( )
4713
+ #endif
4714
+ } ;
4701
4715
formatter . Serialize ( stream , s ) ;
4702
4716
4703
4717
// close the original session
0 commit comments