public void Handle(RemovedRoleFromRoleGroup message) { HashSet<Guid> roles; if (_rolesInRoleGroup.TryGetValue(message.RoleGroupId, out roles)) { roles.Remove(message.RoleId); if (roles.Count == 0) _rolesInRoleGroup.Remove(message.RoleGroupId); } }
void When(RemovedRoleFromRoleGroup @event) { _roles.Remove(new RoleId(@event.RoleId)); }