Beispiel #1
0
        //PUT: api/User?id=5&u=xx
        public async Task <HandleResult> Put(string id, string u)
        {
            var command = new UnLockedUser(id);
            var result  = await ExecuteCommandAsync(command);

            if (result.IsSuccess())
            {
                return(HandleResult.FromSuccess("解锁成功"));
            }
            return(HandleResult.FromFail(result.GetErrorMessage()));
        }
Beispiel #2
0
 /// <summary>解锁用户
 /// </summary>
 public void Handle(ICommandContext context, UnLockedUser command)
 {
     context.Get <User>(command.AggregateRootId).Unlock();
 }