Using Records with Primary Constructors instead of Class for Commands / Queries
A reference .NET application implementing an eCommerce site
Brought to you by:
jobily
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