DEV Community

Discussion on: Where would you use the new C# 9 Record Type

Collapse
 
klyse profile image
klyse

Hi,
thanks for the comment! I agree records can be great for DTOs and Commands (I'm also thinking about MediatR). As Jimmy Bogard mentioned in his blog post upon until now Immutable objects could not be serialized easily. Now that we have records they are immutable and can be serialized 🎈. Here is a small example of the serialization (I couldn't believe it, I had to try it myself :D) dotnetfiddle.net/e8tSIN