Skip to content

Commit 8a8b5c7

Browse files
Generic class constructor rearrangement
1 parent 35cc522 commit 8a8b5c7

1 file changed

Lines changed: 11 additions & 2 deletions

File tree

src/OneBitSoftware.Utilities.OperationResult/OperationResult.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,17 @@ public OperationResult(ILogger loggerService) : base(loggerService)
241241
/// <param name="resultObject">An initial failure message for the operation result. This will fail the success status.</param>
242242
/// <param name="loggerService">An instance of <see cref="ILoggerService"/>.</param>
243243
/// <remarks>If the operation is a get operation, an empty result must return a truthy Success value.</remarks>
244-
public OperationResult(ILogger loggerService, TResult resultObject)
245-
: base(loggerService)
244+
public OperationResult(TResult resultObject, ILogger loggerService) : base(loggerService)
245+
{
246+
this.RelatedObject = resultObject;
247+
}
248+
249+
/// <summary>
250+
/// Initializes a new instance of the <see cref="OperationResult"/> class and sets the passed result object. Internally, this will set the Success result to True.
251+
/// </summary>
252+
/// <param name="resultObject">An initial failure message for the operation result. This will fail the success status.</param>
253+
/// <remarks>If the operation is a get operation, an empty result must return a truthy Success value.</remarks>
254+
public OperationResult(TResult resultObject) : base()
246255
{
247256
this.RelatedObject = resultObject;
248257
}

0 commit comments

Comments
 (0)