angularsen/roslyn-analyzers

[AssignAll] attribute on method for aspect oriented programming

angularsen opened this issue · 0 comments

Magic comments like // AssignAll enable is a bit off-putting.

It would be more natural and discoverable with:

[AssignAll]
public PersonDto ToDto(Person entity)
{
	return new PersonDto
	{
		FullName = $"{entity.FirstName} {entity.LastName}"
	};
}

Instead of:

public PersonDto ToDto(Person entity)
{
    // AssignAll enable
	return new PersonDto
	{
		FullName = $"{entity.FirstName} {entity.LastName}"
	};
    // AssignAll disable
}