@@ -126,12 +126,6 @@ public override void WriteBinaryData(BsonBinaryData binaryData)
126126 WriteNameHelper ( Name ) ;
127127 switch ( Settings . OutputMode )
128128 {
129- #pragma warning disable 618
130- case JsonOutputMode . Strict :
131- #pragma warning restore 618
132- _textWriter . Write ( "{{ \" $binary\" : \" {0}\" , \" $type\" : \" {1}\" }}" , Convert . ToBase64String ( bytes ) , ( ( int ) subType ) . ToString ( "x2" ) ) ;
133- break ;
134-
135129 case JsonOutputMode . CanonicalExtendedJson :
136130 case JsonOutputMode . RelaxedExtendedJson :
137131 _textWriter . Write ( "{{ \" $binary\" : {{ \" base64\" : \" {0}\" , \" subType\" : \" {1}\" }} }}" , Convert . ToBase64String ( bytes ) , ( ( int ) subType ) . ToString ( "x2" ) ) ;
@@ -198,12 +192,6 @@ public override void WriteDateTime(long value)
198192 WriteNameHelper ( Name ) ;
199193 switch ( Settings . OutputMode )
200194 {
201- #pragma warning disable 618
202- case JsonOutputMode . Strict :
203- #pragma warning restore 618
204- _textWriter . Write ( "{{ \" $date\" : {0} }}" , value ) ;
205- break ;
206-
207195 case JsonOutputMode . RelaxedExtendedJson :
208196 if ( value >= 0 && value <= BsonConstants . DateTimeMaxValueMillisecondsSinceEpoch )
209197 {
@@ -255,9 +243,6 @@ public override void WriteDecimal128(Decimal128 value)
255243 _textWriter . Write ( "NumberDecimal(\" {0}\" )" , value . ToString ( ) ) ;
256244 break ;
257245
258- #pragma warning disable 618
259- case JsonOutputMode . Strict :
260- #pragma warning restore 618
261246 case JsonOutputMode . CanonicalExtendedJson :
262247 case JsonOutputMode . RelaxedExtendedJson :
263248 default :
@@ -303,9 +288,7 @@ public override void WriteDouble(double value)
303288 _textWriter . Write ( stringRepresentation ) ;
304289 }
305290 break ;
306- #pragma warning disable 618
307- case JsonOutputMode . Strict :
308- #pragma warning restore 618
291+
309292 case JsonOutputMode . Shell :
310293 default :
311294 _textWriter . Write ( stringRepresentation ) ;
@@ -420,9 +403,7 @@ public override void WriteInt32(int value)
420403 case JsonOutputMode . CanonicalExtendedJson :
421404 _textWriter . Write ( "{{ \" $numberInt\" : \" {0}\" }}" , value ) ;
422405 break ;
423- #pragma warning disable 618
424- case JsonOutputMode . Strict :
425- #pragma warning restore 618
406+
426407 case JsonOutputMode . RelaxedExtendedJson :
427408 case JsonOutputMode . Shell :
428409 default :
@@ -448,9 +429,6 @@ public override void WriteInt64(long value)
448429 WriteNameHelper ( Name ) ;
449430 switch ( Settings . OutputMode )
450431 {
451- #pragma warning disable 618
452- case JsonOutputMode . Strict :
453- #pragma warning restore 618
454432 case JsonOutputMode . RelaxedExtendedJson :
455433 _textWriter . Write ( value ) ;
456434 break ;
@@ -527,9 +505,6 @@ public override void WriteMaxKey()
527505 WriteNameHelper ( Name ) ;
528506 switch ( Settings . OutputMode )
529507 {
530- #pragma warning disable 618
531- case JsonOutputMode . Strict :
532- #pragma warning restore 618
533508 case JsonOutputMode . CanonicalExtendedJson :
534509 case JsonOutputMode . RelaxedExtendedJson :
535510 _textWriter . Write ( "{ \" $maxKey\" : 1 }" ) ;
@@ -558,9 +533,6 @@ public override void WriteMinKey()
558533 WriteNameHelper ( Name ) ;
559534 switch ( Settings . OutputMode )
560535 {
561- #pragma warning disable 618
562- case JsonOutputMode . Strict :
563- #pragma warning restore 618
564536 case JsonOutputMode . CanonicalExtendedJson :
565537 case JsonOutputMode . RelaxedExtendedJson :
566538 _textWriter . Write ( "{ \" $minKey\" : 1 }" ) ;
@@ -607,9 +579,6 @@ public override void WriteObjectId(ObjectId objectId)
607579 WriteNameHelper ( Name ) ;
608580 switch ( Settings . OutputMode )
609581 {
610- #pragma warning disable 618
611- case JsonOutputMode . Strict :
612- #pragma warning restore 618
613582 case JsonOutputMode . CanonicalExtendedJson :
614583 case JsonOutputMode . RelaxedExtendedJson :
615584 _textWriter . Write ( "{{ \" $oid\" : \" {0}\" }}" , objectId . ToString ( ) ) ;
@@ -642,12 +611,6 @@ public override void WriteRegularExpression(BsonRegularExpression regex)
642611 WriteNameHelper ( Name ) ;
643612 switch ( Settings . OutputMode )
644613 {
645- #pragma warning disable 618
646- case JsonOutputMode . Strict :
647- #pragma warning restore 618
648- _textWriter . Write ( "{{ \" $regex\" : \" {0}\" , \" $options\" : \" {1}\" }}" , EscapedString ( pattern ) , EscapedString ( options ) ) ;
649- break ;
650-
651614 case JsonOutputMode . CanonicalExtendedJson :
652615 case JsonOutputMode . RelaxedExtendedJson :
653616 _textWriter . Write ( "{{ \" $regularExpression\" : {{ \" pattern\" : \" {0}\" , \" options\" : \" {1}\" }} }}" , EscapedString ( pattern ) , EscapedString ( options ) ) ;
@@ -759,9 +722,6 @@ public override void WriteTimestamp(long value)
759722 WriteNameHelper ( Name ) ;
760723 switch ( Settings . OutputMode )
761724 {
762- #pragma warning disable 618
763- case JsonOutputMode . Strict :
764- #pragma warning restore 618
765725 case JsonOutputMode . CanonicalExtendedJson :
766726 case JsonOutputMode . RelaxedExtendedJson :
767727 _textWriter . Write ( "{{ \" $timestamp\" : {{ \" t\" : {0}, \" i\" : {1} }} }}" , secondsSinceEpoch , increment ) ;
@@ -790,9 +750,6 @@ public override void WriteUndefined()
790750 WriteNameHelper ( Name ) ;
791751 switch ( Settings . OutputMode )
792752 {
793- #pragma warning disable 618
794- case JsonOutputMode . Strict :
795- #pragma warning restore 618
796753 case JsonOutputMode . CanonicalExtendedJson :
797754 case JsonOutputMode . RelaxedExtendedJson :
798755 _textWriter . Write ( "{ \" $undefined\" : true }" ) ;
0 commit comments