Skip to content
Merged
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
24 changes: 24 additions & 0 deletions src/Ardalis.Result/Result.Void.cs
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,30 @@ public static Result<T> Success<T>(T value, string successMessage)
return new Result<T>(value, successMessage);
}

/// <summary>
/// Represents a successful operation that resulted in the creation of a new resource.
/// Accepts a value as the result of the operation.
/// </summary>
/// <param name="value">Sets the Value property</param>
/// <returns>A Result<typeparamref name="T"/></returns>
public static Result<T> Created<T>(T value)
{
return Result<T>.Created(value);
}

/// <summary>
/// Represents a successful operation that resulted in the creation of a new resource.
/// Accepts a value as the result of the operation.
/// Accepts a location for the new resource.
/// </summary>
/// <param name="value">Sets the Value property</param>
/// <param name="location">The location of the newly created resource</param>
/// <returns>A Result<typeparamref name="T"/></returns>
public static Result<T> Created<T>(T value, string location)
{
return Result<T>.Created(value, location);
}

/// <summary>
/// Represents an error that occurred during the execution of the service.
/// Error messages may be provided and will be exposed via the Errors property.
Expand Down