Пример #1
0
 public PolicyUserDTO(PolicyUserMsgs.PolicyUserAdded @event)
 {
     PolicyUserId   = @event.PolicyUserId;
     UserId         = @event.UserId;
     PolicyId       = @event.PolicyId;
     RolesCache     = _rolesSource.AsObservableCache();
     OneRolePerUser = @event.OneRolePerUser;
 }
Пример #2
0
        public void Handle(PolicyUserMsgs.PolicyUserAdded @event)
        {
            var policy = _policies.Lookup(@event.PolicyId);

            if (policy.HasValue && !_policyUsers.ContainsKey(@event.PolicyUserId))
            {
                var policyUser = new PolicyUserDTO(@event);
                _policyUsers.Add(@event.PolicyUserId, policyUser);
                policy.Value.Users.AddOrUpdate(policyUser);
            }
        }