Refactor CreateEnvelopeCommand authorization method
Replaced the `Authorize` method with a new `WithAuth` method in the `CreateEnvelopeCommand` class. The new method sets the `UserId` property and returns the current instance, enabling method chaining and improving usability.
This commit is contained in:
@@ -40,10 +40,10 @@ public record CreateEnvelopeCommand : IRequest<EnvelopeDto?>
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="userId"></param>
|
/// <param name="userId"></param>
|
||||||
/// <returns></returns>
|
/// <returns></returns>
|
||||||
public bool Authorize(int userId)
|
public CreateEnvelopeCommand WithAuth(int userId)
|
||||||
{
|
{
|
||||||
UserId = userId;
|
UserId = userId;
|
||||||
return true;
|
return this;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user