Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Convention: Command properties should not contain public setters #12

Open
SebastianKuesters opened this issue Oct 24, 2022 · 1 comment
Labels
documentation Improvements or additions to documentation

Comments

@SebastianKuesters
Copy link
Member

public class DeleteToDoListCommand : ICommand
{
    public Guid Id { get; } // This, if not changed

    public Guid TenantId { get; private set; } // This, if changed by method

    public DeleteToDoListCommand(Guid id, Guid tenantId)
    {
        Id = id;
        TenantId = tenantId;
    }

    public void ChangeTenantId() {
       // ....
    }
}
@SebastianKuesters SebastianKuesters added the documentation Improvements or additions to documentation label Oct 24, 2022
@SebastianKuesters
Copy link
Member Author

This could not work, if we do a Adapt<> and need assign a property later.
Maybe we will not use the Adapt here anymore, because then you can forget the not adaptable properties later...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation
Projects
None yet
Development

No branches or pull requests

1 participant