-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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-4886: Mark API that will be removed in 3.0 as obsolete: MongoDB.Bson #1243
base: master
Are you sure you want to change the base?
Changes from 2 commits
fb35b8e
58ccbce
b3136da
3f876e3
fd43e74
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 |
---|---|---|
|
@@ -47,6 +47,7 @@ public JsonWriterSettings() | |
/// <summary> | ||
/// Gets or sets the default JsonWriterSettings. | ||
/// </summary> | ||
[Obsolete("This property will be removed in later release.")] | ||
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. The intention is also to remove all the static defaults and settings related to serialization. |
||
public static JsonWriterSettings Defaults | ||
{ | ||
get | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -21,6 +21,7 @@ namespace MongoDB.Bson | |
/// <summary> | ||
/// Represents a BSON symbol value. | ||
/// </summary> | ||
[Obsolete("This class will be removed in later release.")] | ||
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. Why is this being deprecated? What if a document in the database contains this type of BSON value? 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. Looks like Symbol was deprecated in 1.7. |
||
public class BsonSymbol : BsonValue, IComparable<BsonSymbol>, IEquatable<BsonSymbol> | ||
{ | ||
// private fields | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -47,10 +47,13 @@ public enum BsonType | |
/// BSON binary data. | ||
/// </summary> | ||
Binary = 0x05, | ||
|
||
/// <summary> | ||
/// A BSON undefined value. | ||
/// </summary> | ||
[Obsolete("Undefined type is depricated and will be removed in later release.")] | ||
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. Why is this being deprecated? What if a document in the database contains this type of BSON value? 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 depreciated, so users should be informed not to use it accidently. |
||
Undefined = 0x06, | ||
|
||
/// <summary> | ||
/// A BSON ObjectId. | ||
/// </summary> | ||
|
@@ -75,10 +78,13 @@ public enum BsonType | |
/// BSON JavaScript code. | ||
/// </summary> | ||
JavaScript = 0x0d, | ||
|
||
/// <summary> | ||
/// A BSON symbol. | ||
/// </summary> | ||
[Obsolete("Symbol type is depricated and will be removed in later release.")] | ||
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. Why is this being deprecated? What if a document in the database contains this type of BSON value? 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 depreciated, so users should be informed not to use it accidently. |
||
Symbol = 0x0e, | ||
|
||
/// <summary> | ||
/// BSON JavaScript code with a scope (a set of variables with values). | ||
/// </summary> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ namespace MongoDB.Bson.Serialization | |
/// <summary> | ||
/// Provides serializers based on an attribute. | ||
/// </summary> | ||
[Obsolete("This class will be removed in later release.")] | ||
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. Really? 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. Do we need it as a pubic class? |
||
public class AttributedSerializationProvider : BsonSerializationProviderBase | ||
{ | ||
/// <inheritdoc/> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,6 +23,7 @@ namespace MongoDB.Bson.Serialization | |
/// <summary> | ||
/// Provides serializers for BsonValue and its derivations. | ||
/// </summary> | ||
[Obsolete("This class will be removed in later release.")] | ||
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. Really? 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. Do we need it as a pubic class? |
||
public class BsonObjectModelSerializationProvider : BsonSerializationProviderBase | ||
{ | ||
private static readonly Dictionary<Type, IBsonSerializer> __serializers; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,7 @@ namespace MongoDB.Bson.Serialization | |
/// <summary> | ||
/// Provides serializers for collections. | ||
/// </summary> | ||
[Obsolete("This class will be removed in later release.")] | ||
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. Really? 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. Do we need it as a pubic class (and other providers)? 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. Users can write custom serialization providers and in general configure any mix of serialization providers in any order. To do so the providers need to be public. Removing these classes (or making them internal) removes a feature. |
||
public class CollectionsSerializationProvider : BsonSerializationProviderBase | ||
{ | ||
private static readonly Dictionary<Type, Type> __serializerTypes; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -24,6 +24,7 @@ namespace MongoDB.Bson.Serialization | |
/// <summary> | ||
/// A helper class used to create and compile delegates for creator maps. | ||
/// </summary> | ||
[Obsolete("This class will be removed in later release.")] | ||
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. Really? 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. Do we need it as public class, and not as internal static utility? 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 thought when you said "removed" you meant "removed". It probably can be made |
||
public class CreatorMapDelegateCompiler : ExpressionVisitor | ||
{ | ||
// private fields | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ namespace MongoDB.Bson.Serialization | |
/// <summary> | ||
/// Provides a serializer for interfaces. | ||
/// </summary> | ||
[Obsolete("This class will be removed in later release.")] | ||
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. Really? 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. Do we need providers to be public? |
||
public class DiscriminatedInterfaceSerializationProvider : BsonSerializationProviderBase | ||
{ | ||
/// <inheritdoc/> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,13 +78,22 @@ public static BsonBinaryDataGuidGenerator StandardInstance | |
} | ||
|
||
/// <summary> | ||
/// Gets an instance of BsonBinaryDataGuidGenerator for Unspecifed GuidRepresentation. | ||
/// Gets an instance of BsonBinaryDataGuidGenerator for Unspecified GuidRepresentation. | ||
/// </summary> | ||
[Obsolete("This method will be removed in later release. Please use UnspecifiedInstance instead")] | ||
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. Really? 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. Yes, directing to use |
||
public static BsonBinaryDataGuidGenerator UnspecifedInstance | ||
{ | ||
get { return __unspecifiedInstance; } | ||
} | ||
|
||
/// <summary> | ||
/// Gets an instance of BsonBinaryDataGuidGenerator for Unspecified GuidRepresentation. | ||
/// </summary> | ||
public static BsonBinaryDataGuidGenerator UnspecifiedInstance | ||
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. Doesn't this duplicate the property of the same name on line 84? 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. Yes, fixing a typo. |
||
{ | ||
get { return __unspecifiedInstance; } | ||
} | ||
|
||
// public properties | ||
/// <summary> | ||
/// Gets the Guid representation. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ namespace MongoDB.Bson.Serialization.IdGenerators | |
/// </summary> | ||
/// <typeparam name="T">The type of the Id.</typeparam> | ||
// TODO: is it worth trying to remove the dependency on IEquatable<T>? | ||
[Obsolete("This class will be removed in later release.")] | ||
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. Really? 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. Reverted. |
||
public class ZeroIdChecker<T> : IIdGenerator where T : struct, IEquatable<T> | ||
{ | ||
// constructors | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,6 +26,7 @@ namespace MongoDB.Bson.Serialization | |
/// <summary> | ||
/// Provides serializers for primitive types. | ||
/// </summary> | ||
[Obsolete("This class will be removed in later release.")] | ||
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. Really? 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. Will our user be needing our built-in serializer providers? |
||
public class PrimitiveSerializationProvider : BsonSerializationProviderBase | ||
{ | ||
private static readonly Dictionary<Type, Type> __serializersTypes; | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,7 +26,7 @@ namespace MongoDB.Bson.Serialization.Serializers | |
public interface IBsonTupleSerializer | ||
{ | ||
/// <summary> | ||
/// Gets ths serializer for an item. | ||
/// Gets this serializer for an item. | ||
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.
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. Thanks, done. |
||
/// </summary> | ||
/// <param name="itemNumber">The item number.</param> | ||
/// <returns>The serializer for the item.</returns> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -22,6 +22,7 @@ namespace MongoDB.Bson.Serialization | |
/// <summary> | ||
/// Represents a serialization provider based on a mapping from value types to serializer types. | ||
/// </summary> | ||
[Obsolete("This class will be removed in later release.")] | ||
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. Really? |
||
public sealed class TypeMappingSerializationProvider : BsonSerializationProviderBase | ||
{ | ||
// private fields | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,7 +17,10 @@ | |
</PropertyGroup> | ||
|
||
<PropertyGroup> | ||
<NoWarn>NU5100</NoWarn> | ||
<NoWarn> | ||
NU5100; | ||
CS0618 <!--Temporary disable obsolete warnings due the massive volume of warnings--> | ||
</NoWarn> | ||
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. This is a sign that these changes will be painful for our users. 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. But hopefully significantly less painful than just removing API in 3.0 without prior warning. |
||
</PropertyGroup> | ||
|
||
<ItemGroup> | ||
|
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.
This is a sign that these changes will be painful for our users.
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.
Yes, but less painful than just API removal without prior warning. Which is the intention of these obsoletions PRs.
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 think we should have a goal that users who stay on 2.x don't have to deal with these warnings at all.