Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix missing new on Result.Error #194

Merged
merged 7 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/Ardalis.Result.AspNetCore/ResultStatusMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public ResultStatusMap AddDefaultMap()
/// Allows to override default status code for specific Http Methods
/// </summary>
/// <param name="status">Result Status to map.</param>
/// <param name="defaultStatusCode">Default Status Code.<param>
/// <param name="defaultStatusCode">Default Status Code.</param>
/// <param name="configure">A <see cref="Action"/> to configure Status Codes for specific Http Methods.</param>
public ResultStatusMap For(ResultStatus status, HttpStatusCode defaultStatusCode, Action<ResultStatusOptions> configure)
{
Expand Down
13 changes: 7 additions & 6 deletions src/Ardalis.Result/Result.Void.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,10 @@ public static Result Success()
/// Represents a successful operation without return type
/// </summary>
/// <param name="successMessage">Sets the SuccessMessage property</param>
/// <returns>A Result></returns>
/// <returns>A Result</returns>
public static Result SuccessWithMessage(string successMessage)
{
return new Result() { SuccessMessage = successMessage };
return new Result { SuccessMessage = successMessage };
}

/// <summary>
Expand Down Expand Up @@ -69,8 +69,8 @@ public static Result<T> Success<T>(T value, string successMessage)
/// A single error message may be provided and will be exposed via the Errors property.
/// </summary>
/// <param name="errorMessage"></param>
/// <returns></returns>
public static Result Error(string errorMessage)
/// <returns>A Result</returns>
public new static Result Error(string errorMessage)
{
return new Result(ResultStatus.Error) { Errors = new[] { errorMessage } };
}
Expand Down Expand Up @@ -173,7 +173,7 @@ public static Result Error(string errorMessage)
/// such as an edit conflict between multiple concurrent updates.
/// See also HTTP 409 Conflict: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_client_errors
/// </summary>
/// <returns>A Result<typeparamref name="T"/></returns>
/// <returns>A Result</returns>
public new static Result Conflict()
{
return new Result(ResultStatus.Conflict);
Expand All @@ -186,7 +186,7 @@ public static Result Error(string errorMessage)
/// See also HTTP 409 Conflict: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#4xx_client_errors
/// </summary>
/// <param name="errorMessages">A list of string error messages.</param>
/// <returns>A Result<typeparamref name="T"/></returns>
/// <returns>A Result</returns>
public new static Result Conflict(params string[] errorMessages)
{
return new Result(ResultStatus.Conflict) { Errors = errorMessages };
Expand All @@ -204,6 +204,7 @@ public static Result Error(string errorMessage)
return new Result(ResultStatus.Unavailable) { Errors = errorMessages };
}

/// <summary>
/// Represents a critical error that occurred during the execution of the service.
/// Everything provided by the user was valid, but the service was unable to complete due to an exception.
/// See also HTTP 500 Internal Server Error: https://en.wikipedia.org/wiki/List_of_HTTP_status_codes#5xx_server_errors
Expand Down
Loading