roslyn-analyzers icon indicating copy to clipboard operation
roslyn-analyzers copied to clipboard

[AssignAll] attribute on method for aspect oriented programming

Open angularsen opened this issue 4 years ago • 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
}

angularsen avatar Oct 15 '20 09:10 angularsen