Closed mrs01dev closed 3 years ago
Could you give an example about the issue?
Here is a sample class:
namespace IssueTracking.Domain.Issues
{
public class Issue : AggregateRoot
protected Issue()
{
}
public Issue(
Guid id,
Guid repositoryId,
string title,
string text,
Guid? assignedUserId,
bool isClosed
) : base(id)
{
repositoryId = repositoryId;
title = title;
text = text;
assignedUserId = assignedUserId;
isClosed = isClosed;
}
}
}
The correct constructor -prefix parameters with _ underscore symbol - is public Issue( Guid id, Guid _repositoryId, string _title, string _text, Guid? _assignedUserId, bool _isClosed
) : base(id)
{
repositoryId = _repositoryId;
title = _title;
text = _text;
assignedUserId = _assignedUserId;
isClosed = _isClosed;
}
camelCase Style is used instead of PascalCase For public fields, public properties , that is the reason. Thanks.
As you said, public properties should be PascalCase, then the warning would be gone.
All c# class constructors generated via EasyAbp AbpHelper.CLI has an issue : Severity Code Description Project File Line Suppression State Warning,CS1717,Assignment made to same variable; did you mean to assign something else? I solve this issue by two regular expression replacement (using notepad Plus Plus): First replace: (.) (.),\r\n with \1 _\2,\r\n
Second replace: (.) = (.);\r\n with \1 = _\2;\r\n