public void AddToRole(Guid userID, string role) { var e = new UserAddedToRoleEvent(Guid.NewGuid(), Guid.Empty, Version + 1, DateTime.UtcNow) { UserID = userID, Role = role, TimeStamp = DateTime.UtcNow }; ApplyEvent(e); }
protected void OnUserAddedToRoleEvent(UserAddedToRoleEvent e) { if (_roles == null) { _roles = new List<string>(); } if (!_roles.Contains(e.Role)) { _roles.Add(e.Role); } }