Skip to content

Commit 15fc205

Browse files
committed
Restrict BaseResult property setters to internal
Prevents external consumers from mutating Success, Message, StatusCode, Errors, and Metadata directly on a ServiceResult.
1 parent b81c78a commit 15fc205

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

src/Initium/Results/BaseResult.cs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,28 +15,28 @@ public abstract class BaseResult
1515
/// <summary>
1616
/// Gets or sets a value indicating whether the operation was successful.
1717
/// </summary>
18-
public bool Success { get; set; }
18+
public bool Success { get; internal set; }
1919

2020
/// <summary>
2121
/// Gets or sets the message providing additional details about the operation or its outcome.
2222
/// </summary>
23-
public string? Message { get; set; }
23+
public string? Message { get; internal set; }
2424

2525
/// <summary>
2626
/// Gets or sets the HTTP status code associated with the result, indicating the outcome of the operation.
2727
/// </summary>
28-
public HttpStatusCode? StatusCode { get; set; }
29-
28+
public HttpStatusCode? StatusCode { get; internal set; }
29+
3030
/// <summary>
3131
/// Gets or sets the collection of structured errors associated with the result.
3232
/// Each <see cref="ApiError"/> provides details such as an error code and description.
3333
/// </summary>
34-
public IEnumerable<ApiError>? Errors { get; set; }
35-
34+
public IEnumerable<ApiError>? Errors { get; internal set; }
35+
3636
/// <summary>
3737
/// Gets or sets metadata associated with the result, which can be mapped to HTTP headers.
3838
/// </summary>
39-
public Dictionary<string, string> Metadata { get; set; } = new();
39+
public Dictionary<string, string> Metadata { get; internal set; } = new();
4040

4141
/// <summary>
4242
/// Copies all properties from another <see cref="BaseResult"/> into this instance.

0 commit comments

Comments
 (0)