tangxuehua / forum

a forum implemented by enode framework.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

fix bug when register forum account

tangxuehua opened this issue · comments

    public void Handle(ICommandContext context, RegisterNewAccountCommand command)
    {
        _lockService.ExecuteInLock(typeof(Account).Name, () =>
        {
            _registerAccountService.RegisterAccount(command.AggregateRootId, command.Name);
            context.Add(new Account(command.AggregateRootId, command.Name, command.Password));
        });
    }`

public void Handle(ICommandContext context, RegisterNewAccountCommand command) { _lockService.ExecuteInLock(typeof(Account).Name, () => { var account = new Account(command.AggregateRootId, command.Name, command.Password); _registerAccountService.RegisterAccount(command.AggregateRootId, command.Name); context.Add(account); }); }