Inheritance: Ncqrs.Eventing.Sourcing.SourcedEvent, IIdentifiable
Esempio n. 1
0
        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);
        }
Esempio n. 2
0
 protected void OnUserAddedToRoleEvent(UserAddedToRoleEvent e)
 {
     if (_roles == null)
     {
         _roles = new List<string>();
     }
     if (!_roles.Contains(e.Role))
     {
         _roles.Add(e.Role);
     }
 }