File tree Expand file tree Collapse file tree 4 files changed +10
-15
lines changed
MongoDB.Driver.Encryption
Linq/Linq3Implementation/Ast Expand file tree Collapse file tree 4 files changed +10
-15
lines changed Original file line number Diff line number Diff line change @@ -281,7 +281,7 @@ private static BsonDocument CreateEncryptDocument(
281
281
282
282
if ( bsonTypes != null )
283
283
{
284
- var convertedBsonTypes = bsonTypes . Select ( type => type . ToStringRepresentation ( ) ) . ToList ( ) ;
284
+ var convertedBsonTypes = bsonTypes . Select ( Utils . ConvertBsonTypeToServerRepresentation ) . ToList ( ) ;
285
285
286
286
if ( convertedBsonTypes . Count == 0 )
287
287
{
Original file line number Diff line number Diff line change 14
14
*/
15
15
16
16
using System ;
17
+ using MongoDB . Bson ;
17
18
18
- namespace MongoDB . Bson
19
+ namespace MongoDB . Driver . Core . Misc
19
20
{
20
- /// <summary>
21
- /// A static class containing extension methods for <see cref="BsonType"/>.
22
- /// </summary>
23
- public static class BsonTypeExtensions
21
+ internal static class Utils
24
22
{
25
- /// <summary>
26
- /// Maps a <see cref="BsonType"/> to its corresponding string representation.
27
- /// </summary>
28
- /// <param name="type">The input type to map.</param>
29
- public static string ToStringRepresentation ( this BsonType type )
23
+ public static string ConvertBsonTypeToServerRepresentation ( BsonType type )
30
24
{
31
25
return type switch
32
26
{
@@ -54,4 +48,4 @@ public static string ToStringRepresentation(this BsonType type)
54
48
} ;
55
49
}
56
50
}
57
- }
51
+ }
Original file line number Diff line number Diff line change 16
16
using System ;
17
17
using MongoDB . Bson ;
18
18
using MongoDB . Bson . Serialization ;
19
+ using MongoDB . Driver . Core . Misc ;
19
20
20
21
namespace MongoDB . Driver . Linq . Linq3Implementation . Ast
21
22
{
22
23
internal static class AstEnumExtensions
23
24
{
24
- public static string Render ( this BsonType type ) => type . ToStringRepresentation ( ) ;
25
+ public static string Render ( this BsonType type ) => Utils . ConvertBsonTypeToServerRepresentation ( type ) ;
25
26
26
27
public static string Render ( this ByteOrder byteOrder )
27
28
{
Original file line number Diff line number Diff line change @@ -52,11 +52,11 @@ public override BsonValue Render()
52
52
if ( _types . Count == 1 )
53
53
{
54
54
var type = _types [ 0 ] ;
55
- return new BsonDocument ( "$type" , type . ToStringRepresentation ( ) ) ;
55
+ return new BsonDocument ( "$type" , Utils . ConvertBsonTypeToServerRepresentation ( type ) ) ;
56
56
}
57
57
else
58
58
{
59
- return new BsonDocument ( "$type" , new BsonArray ( _types . Select ( type => type . ToStringRepresentation ( ) ) ) ) ;
59
+ return new BsonDocument ( "$type" , new BsonArray ( _types . Select ( Utils . ConvertBsonTypeToServerRepresentation ) ) ) ;
60
60
}
61
61
}
62
62
}
You can’t perform that action at this time.
0 commit comments