dennisdoomen / CSharpGuidelines

A set of coding guidelines for C# 9.0, design principles and layout rules for improving the overall quality of your code development.
https://www.csharpcodingguidelines.com
Other
745 stars 272 forks source link

Should records be added as an exception to AV1561 (max 3 parameters in signature)? #270

Closed weelink closed 11 months ago

weelink commented 11 months ago

We are using C# records for modelling our events. Because all the events have at least the aggregate id, this rule limits the amount of extra information to 2, which is not very practical, e.g:

public sealed record UserImportedEvent(
    Guid Id,
    string ExternalId,
    string Name,
    string EmailAddress
) : IEvent;

Currently we use #pragma warning disable AV1561, but I think this should be an exception.

bkoelman commented 11 months ago

@weelink it looks like you're in the wrong repository. Please create your issue at https://github.com/bkoelman/CSharpGuidelinesAnalyzer instead.

weelink commented 11 months ago

I wasn't too sure about where to put this. The #pragma is the analyzer, but the principle is the convention. But I'll add this to the other repository. Thanks.