public void Execute(ICommandContext context, SampleCommand command) { var root = context.GetAggregateRoot(command.AggregateId, () => SampleAggregateRoot.Register(command)); root.Create(command); }
public static SampleAggregateRoot Register(SampleCommand command) { var root = new SampleAggregateRoot(command.AggregateId); return(root); }