You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
[dotnet] Obsolete setters and constructors on Response that are not conducive to immutability (#15107)
* [dotnet] Obsoletes setters on `Response` type
* [dotnet] Obsolete constructors on `Response` that are not conducive to immutability
* Avoid obsolete `Response` constructor
Copy file name to clipboardExpand all lines: dotnet/src/webdriver/Response.cs
+22-3
Original file line number
Diff line number
Diff line change
@@ -42,6 +42,7 @@ public class Response
42
42
/// <summary>
43
43
/// Initializes a new instance of the <see cref="Response"/> class
44
44
/// </summary>
45
+
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
45
46
publicResponse()
46
47
{
47
48
}
@@ -50,6 +51,7 @@ public Response()
50
51
/// Initializes a new instance of the <see cref="Response"/> class
51
52
/// </summary>
52
53
/// <param name="sessionId">Session ID in use</param>
54
+
[Obsolete("Set all values using the Response(string, object, WebDriverResult) constructor instead. This constructor will be removed in Selenium 4.30")]
53
55
publicResponse(SessionId?sessionId)
54
56
{
55
57
this.SessionId=sessionId?.ToString();
@@ -136,18 +138,35 @@ public static Response FromJson(string value)
136
138
/// <summary>
137
139
/// Gets or sets the value from JSON.
138
140
/// </summary>
139
-
publicobject?Value{get;set;}
141
+
publicobject?Value
142
+
{
143
+
get;
144
+
145
+
[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
146
+
set;
147
+
}
140
148
141
149
/// <summary>
142
150
/// Gets or sets the session ID.
143
151
/// </summary>
144
-
publicstring?SessionId{get;set;}
152
+
publicstring?SessionId
153
+
{
154
+
get;
155
+
156
+
[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
157
+
set;
158
+
}
145
159
146
160
/// <summary>
147
161
/// Gets or sets the status value of the response.
148
162
/// </summary>
149
-
publicWebDriverResultStatus{get;set;}
163
+
publicWebDriverResultStatus
164
+
{
165
+
get;
150
166
167
+
[Obsolete("The Response type will be immutable and this setter will be removed in Selenium 4.30")]
168
+
set;
169
+
}
151
170
152
171
/// <summary>
153
172
/// Returns a new <see cref="Response"/> from a JSON-encoded string.
0 commit comments