تخطَّ إلى المحتوى

File name matches type (ARCH713)

هذا المحتوى غير متوفر بلغتك بعد.

Key dotnet.codequality.file-name-matches-type · Severity info · Category codequality

Matching the file name to the primary type it contains makes the codebase easier to navigate and supports the one-type-per-file convention.

Helpers.cs
public sealed class InvoiceCalculator
{
public decimal Total(Invoice invoice) => invoice.Lines.Sum(l => l.Amount);
}
InvoiceCalculator.cs
public sealed class InvoiceCalculator
{
public decimal Total(Invoice invoice) => invoice.Lines.Sum(l => l.Amount);
}

Rename the file to match the name of the primary type it contains.