Closed leotsarev closed 3 years ago
Hi @leotsarev,
Example:
public record Address(string Street, string ZipCode);
Unfortunately, C# records don’t implement the IComparable interface, which means that the following code doesn’t work:
var address1 = new Address("1234 Main St", "20012");
var address2 = new Address("1235 Main St", "20012");
Address[] addresses = new[] { address1, address2 }.OrderBy(x => x).ToArray();
If you try to run it, .NET will throw an exception:
Failed to compare two elements in the array. At least one object must implement IComparable.
Hi everyone! C# 9 now introduced record types. I wonder if it's good fit to replace (or at least be supported on par with) for Eventflow.ValueObject Does anyone has in mind what should be done for support of records?