C#C
C#2y ago
SpReeD

Yet another question about struct & class

So, here I am, having this code

public readonly record struct MinifigureDto {
    public required int Id { get; init; }
    public required string Name { get; init; }
    public required int ThemeId { get; init; }
    public required uint Amount { get; init; }
}


This object won't change during runtime, so, should I make it a struct or a class?
What is the devil in the detail?
Was this page helpful?