public IEnumerable Handle(LockRole c) { if (_locked) { throw new InvalidOperationException("角色已锁定!"); } yield return(new RoleLocked { Id = c.Id }); }
public IHttpActionResult LockRole(LockRole role) { _messageDispatcher.SendCommand(role); return(Ok()); }