Menu

#116 Using Records with Primary Constructors instead of Class for Commands / Queries

open
nobody
None
2023-12-01
2023-12-01
Anonymous
No

Originally created by: hanyfakhry

Great work with all the amazing new features, one enhancement i believe it can be done to move commands from classes to be records for example CancelOrderCommand:

public class CancelOrderCommand(int orderNumber) : IRequest<bool>
{
    [DataMember]
    public int OrderNumber { get; set; } = orderNumber;
}

To Be

public record CancelOrderCommand(int OrderNumber) : IRequest<bool>;

This will make the Commands more readable and less code

Related

Tickets: #123

Discussion


Log in to post a comment.