-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CSHARP-3985: Support multiple SerializerRegistries #1592
base: main
Are you sure you want to change the base?
Changes from 43 commits
5a93d57
bc33071
5e94e62
a317994
0e2f7b9
a051d18
bb60887
56a9b7e
3f634d5
550eb97
d2e1746
8b14426
3dadb07
cf05d41
35f461a
7c2beb3
3ad811e
0ae768c
01330fd
7bec37f
bb395b0
d7756c6
70f351b
cc40c72
04d45fa
8305dc1
402a889
6d2faf9
5ac0c06
7628f31
3f5a047
9ccfe7a
d3973e1
a587d6d
856cfb8
2cc6a8d
5742541
d6d9ddc
3b27b43
98682bb
dc33112
a45b027
3f9c37c
f0487d3
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
*/ | ||
|
||
using System; | ||
using MongoDB.Bson.Serialization; | ||
|
||
namespace MongoDB.Bson.IO | ||
{ | ||
|
@@ -25,6 +26,7 @@ public abstract class BsonWriterSettings | |
// private fields | ||
private bool _isFrozen; | ||
private int _maxSerializationDepth = BsonDefaults.MaxSerializationDepth; | ||
private IBsonSerializationDomain _serializationDomain; | ||
|
||
// constructors | ||
/// <summary> | ||
|
@@ -92,6 +94,19 @@ public BsonWriterSettings FrozenCopy() | |
} | ||
} | ||
|
||
/// <summary> | ||
/// //TODO | ||
/// </summary> | ||
public IBsonSerializationDomain SerializationDomain | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't find anywhere this property is used. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's used in the constructor of the |
||
{ | ||
get => _serializationDomain; | ||
set | ||
{ | ||
if (_isFrozen) { ThrowFrozenException(); } | ||
_serializationDomain = value; | ||
} | ||
} | ||
|
||
// protected methods | ||
/// <summary> | ||
/// Creates a clone of the settings. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -62,7 +62,7 @@ public interface IBsonReader : IDisposable | |
/// <summary> | ||
/// Pops the settings. | ||
/// </summary> | ||
void PopSettings(); | ||
void PopSettings(); //TODO Why do we have push and pop methods? They are not used | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm surprised they are not used. The matching methods in |
||
|
||
/// <summary> | ||
/// Pushes new settings for the reader. | ||
|
@@ -246,6 +246,11 @@ public interface IBsonReader : IDisposable | |
/// <param name="bookmark">The bookmark.</param> | ||
void ReturnToBookmark(BsonReaderBookmark bookmark); | ||
|
||
/// <summary> | ||
/// Gets the settings of the reader. | ||
/// </summary> | ||
BsonReaderSettings Settings { get; } | ||
|
||
/// <summary> | ||
/// Skips the name (reader must be positioned on a name). | ||
/// </summary> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't find anywhere this property is used.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It's used in the constructor of the
BsonDeserializationContext
.