@@ -89,29 +89,13 @@ public class CdpServicesDal : Dal
89
89
/// </summary>
90
90
private HttpClient httpClient ;
91
91
92
- /// <summary>
93
- /// Asserts that the MessagePack deserialization should be used or not
94
- /// </summary>
95
- private readonly bool isMessagePackSupported ;
96
-
97
- /// <summary>
98
- /// Initializes a new instance of the <see cref="CdpServicesDal"/> class.
99
- /// </summary>
100
- public CdpServicesDal ( ) : this ( true )
101
- {
102
- // Default constructor
103
- }
104
-
105
92
/// <summary>
106
93
/// Initializes a new instance of the <see cref="CdpServicesDal"/> class.
107
94
/// </summary>
108
- /// <param name="isMessagePackSupported">Asserts that the MessagePack deserialization should be used or not. Supported by default</param>
109
- public CdpServicesDal ( bool isMessagePackSupported )
95
+ public CdpServicesDal ( )
110
96
{
111
97
this . Cdp4DalJsonSerializer = new Cdp4DalJsonSerializer ( this . MetaDataProvider , this . DalVersion , false ) ;
112
98
this . MessagePackSerializer = new MessagePackSerializer ( ) ;
113
-
114
- this . isMessagePackSupported = isMessagePackSupported ;
115
99
}
116
100
117
101
/// <summary>
@@ -120,15 +104,9 @@ public CdpServicesDal(bool isMessagePackSupported)
120
104
/// <param name="httpClient">
121
105
/// The (injected) <see cref="HttpClient"/>
122
106
/// </param>
123
- /// <param name="isMessagePackSupported">Asserts that the MessagePack deserialization should be used or not. Supported by default</param>
124
- public CdpServicesDal ( HttpClient httpClient , bool isMessagePackSupported = true ) : this ( isMessagePackSupported )
107
+ public CdpServicesDal ( HttpClient httpClient ) : this ( )
125
108
{
126
- if ( httpClient == null )
127
- {
128
- throw new ArgumentNullException ( nameof ( httpClient ) ) ;
129
- }
130
-
131
- this . httpClient = httpClient ;
109
+ this . httpClient = httpClient ?? throw new ArgumentNullException ( nameof ( httpClient ) ) ;
132
110
}
133
111
134
112
/// <summary>
@@ -1106,11 +1084,7 @@ private HttpClient CreateHttpClient(Credentials credentials, HttpClient injected
1106
1084
result . BaseAddress = credentials . Uri ;
1107
1085
result . DefaultRequestHeaders . Accept . Clear ( ) ;
1108
1086
result . DefaultRequestHeaders . Accept . Add ( new MediaTypeWithQualityHeaderValue ( "application/json" ) ) ;
1109
-
1110
- if ( this . isMessagePackSupported )
1111
- {
1112
- result . DefaultRequestHeaders . Accept . Add ( new MediaTypeWithQualityHeaderValue ( "application/msgpack" ) ) ;
1113
- }
1087
+ result . DefaultRequestHeaders . Accept . Add ( new MediaTypeWithQualityHeaderValue ( "application/msgpack" ) ) ;
1114
1088
1115
1089
result . DefaultRequestHeaders . Authorization = new AuthenticationHeaderValue ( "Basic" , Convert . ToBase64String ( ASCIIEncoding . ASCII . GetBytes ( $ "{ credentials . UserName } :{ credentials . Password } ") ) ) ;
1116
1090
result . DefaultRequestHeaders . Add ( Headers . AcceptCdpVersion , Headers . AcceptCdpVersionValue ) ;
0 commit comments