wemogy / libs-cqrs

CQRS framework

Home Page:http://libs-cqrs.docs.wemogy.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Convention: Command properties should not contain public setters

SebastianKuesters opened this issue · comments

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() {
       // ....
    }
}

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...